event.utils.guidle ================== .. py:module:: event.utils.guidle Attributes ---------- .. autoapisummary:: event.utils.guidle._T Classes ------- .. autoapisummary:: event.utils.guidle.GuidleBase event.utils.guidle.GuidleExportData event.utils.guidle.GuidleOffer event.utils.guidle.GuidleScheduleDate Module Contents --------------- .. py:data:: _T .. py:class:: GuidleBase(root: lxml.etree._Element) Base class for parsing guidle exports containing general helpers. .. py:attribute:: root .. py:attribute:: nsmap .. py:attribute:: cleaner .. py:method:: find(path: str, root: lxml.etree._Element | None = None) -> list[lxml.etree._Element] Gets the elements with the given path. .. py:method:: get(path: str, root: lxml.etree._Element | None = None, joiner: str = ' ', parser: None = None) -> str get(path: str, root: lxml.etree._Element | None = None, joiner: str = ' ', *, parser: collections.abc.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. .. py:method:: join(texts: collections.abc.Sequence[str], joiner: str = ', ') -> str Joins a set of text, skips duplicate and empty texts while preserving the order. .. py:class:: GuidleExportData(root: lxml.etree._Element) Bases: :py:obj:`GuidleBase` Represents a whole guidle export. .. py:method:: offers() -> collections.abc.Iterator[GuidleOffer] .. py:class:: GuidleOffer(root: lxml.etree._Element) Bases: :py:obj:`GuidleBase` Represents a single offer containing some description and dates. .. py:property:: uid :type: str | None .. py:property:: last_update :type: str .. py:property:: title :type: str .. py:property:: description :type: str .. py:property:: price :type: str .. py:property:: organizer :type: str .. py:property:: organizer_email :type: str .. py:property:: location :type: str .. py:method:: image(size: str) -> tuple[str, str] | tuple[None, None] Returns the image url for the offer with the given size, together with the filename, or (None, None). .. py:method:: pdf() -> tuple[str, str] | tuple[None, None] Returns the first attachment that is a pdf, together with the filename, or (None, None). .. py:method:: tags(tagmap: collections.abc.Mapping[str, str] | None = None) -> tuple[set[str], set[str]] Returns a set of known and a set of unkonwn tags. .. py:property:: coordinates :type: onegov.gis.models.coordinates.RealCoordinates | None .. py:method:: schedules() -> collections.abc.Iterator[GuidleScheduleDate] .. py:class:: GuidleScheduleDate(root: lxml.etree._Element) Bases: :py:obj:`GuidleBase` Represents a single schedule date of an offer. .. py:attribute:: start :value: None .. py:attribute:: end :value: None .. py:attribute:: recurrence :value: '' .. py:property:: timezone :type: str