event.utils.guidle

Attributes

_T

Classes

GuidleBase

Base class for parsing guidle exports containing general helpers.

GuidleExportData

Represents a whole guidle export.

GuidleOffer

Represents a single offer containing some description and dates.

GuidleScheduleDate

Represents a single schedule date of an offer.

Module Contents

event.utils.guidle._T[source]
class event.utils.guidle.GuidleBase(root: lxml.etree._Element)[source]

Base class for parsing guidle exports containing general helpers.

root[source]
nsmap[source]
cleaner[source]
find(path: str, root: _Element | None = None) list[lxml.etree._Element][source]

Gets the elements with the given path.

get(path: str, root: _Element | None = None, joiner: str = ' ', parser: None = None) str[source]
get(path: str, root: _Element | None = None, joiner: str = ' ', *, parser: Callable[[str], _T]) _T | None

Returns the text of the elements with the given path.

Allows to specifiy a joining character and optionally a parser. If no parser is given, the text is HTML-cleaned.

join(texts: Sequence[str], joiner: str = ', ') str[source]

Joins a set of text, skips duplicate and empty texts while preserving the order.

class event.utils.guidle.GuidleExportData(root: lxml.etree._Element)[source]

Bases: GuidleBase

Represents a whole guidle export.

offers() Iterator[GuidleOffer][source]
class event.utils.guidle.GuidleOffer(root: lxml.etree._Element)[source]

Bases: GuidleBase

Represents a single offer containing some description and dates.

property uid: str | None[source]
property last_update: str[source]
property title: str[source]
property description: str[source]
property price: str[source]
property organizer: str[source]
property organizer_email: str[source]
property location: str[source]
image(size: str) tuple[str, str] | tuple[None, None][source]

Returns the image url for the offer with the given size, together with the filename, or (None, None).

pdf() tuple[str, str] | tuple[None, None][source]

Returns the first attachment that is a pdf, together with the filename, or (None, None).

tags(tagmap: Mapping[str, str] | None = None) tuple[set[str], set[str]][source]

Returns a set of known and a set of unkonwn tags.

property coordinates: RealCoordinates | None[source]
schedules() Iterator[GuidleScheduleDate][source]
class event.utils.guidle.GuidleScheduleDate(root: lxml.etree._Element)[source]

Bases: GuidleBase

Represents a single schedule date of an offer.

start[source]
end[source]
recurrence = ''[source]
weekdays[source]
start_time[source]
end_time[source]
property timezone: str[source]