event.cli ========= .. py:module:: event.cli Attributes ---------- .. autoapisummary:: event.cli.cli Functions --------- .. autoapisummary:: event.cli.clear event.cli.download_file event.cli.get_event_dates event.cli.import_json event.cli.filter_cb event.cli.import_ical event.cli.import_guidle Module Contents --------------- .. py:data:: cli .. py:function:: clear(group_context: onegov.core.cli.core.GroupContext) -> collections.abc.Callable[[onegov.core.request.CoreRequest, onegov.core.framework.Framework], None] Deletes all events. .. code-block:: bash onegov-event --select '/veranstaltungen/zug' clear .. py:function:: download_file(file_url: str, size_limit: int = 1 * 1024 * 1024) -> io.BytesIO | None .. py:function:: get_event_dates(url: str, timezone: str) -> tuple[datetime.datetime, datetime.datetime] Get the start and end datetime of an event in a seantis.dir.events events calendar. The start and end datetime in the seantis.dir.events JSON export is wrong since they refer to the next occurrence and not the first one. This is unusable together with the recurrece .. py:function:: import_json(group_context: onegov.core.cli.core.GroupContext, url: str, tagmap_file: io.TextIOWrapper | None, clear: bool) -> collections.abc.Callable[[onegov.core.request.CoreRequest, onegov.core.framework.Framework], None] Fetches the events from a seantis.dir.events instance. This command is intended for migration and to be removed in the future. Example: .. code-block:: bash onegov-event --select '/veranstaltungen/zug' import-json \ 'https://veranstaltungen.zug.ch/veranstaltungen/?type=json&compact' .. py:function:: filter_cb(ctx: click.Context, param: click.Parameter, value: tuple[str, list[str]] | None) -> dict[str, list[str]] | None .. py:function:: import_ical(group_context: onegov.core.cli.core.GroupContext, ical: io.TextIOWrapper, future_events_only: bool = False, event_image: io.FileIO | None = None, categories: collections.abc.Sequence[str] = (), keyword_filters: dict[str, list[str]] | None = None) -> collections.abc.Callable[[onegov.core.request.CoreRequest, onegov.core.framework.Framework], None] Imports events from an iCalendar file. Examples: .. code-block:: bash onegov-event --select '/veranstaltungen/zug' import-ical import.ics onegov-event --select '/veranstaltungen/zug' import-ical import.ics --future-events-only onegov-event --select '/veranstaltungen/zug' import-ical import.ics \ --event-image /path/to/image.jpg onegov-event --select /onegov_winterthur/winterthur import-ical \ ./basic.ics --future-events-only --event-image \ ~/Veranstaltung_breit.jpg -c Sport -c Fussball onegov-event --select /onegov_winterthur/winterthur import-ical \ ./basic.ics --future-events-only --event-image \ ~/Veranstaltung_breit.jpg \ -f "kalender" "Sport Veranstaltungskalender" or comma-separated filter values: .. code-block:: bash onegov-event --select /onegov_winterthur/winterthur import-ical \ ./basic.ics --future-events-only --event-image image.jpg \ -f "kalender" "Sport,Veranstaltungskalender" .. py:function:: import_guidle(group_context: onegov.core.cli.core.GroupContext, url: str, tagmap_file: io.TextIOWrapper | None, clear: bool) -> collections.abc.Callable[[onegov.core.request.CoreRequest, onegov.core.framework.Framework], None] Fetches the events from guidle. Example: .. code-block:: bash onegov-event --select '/veranstaltungen/zug' import-guidle 'http://www.guidle.com/xxxx/'