event.cli

Attributes

cli

Functions

clear(→ Callable[[CoreRequest, Framework], None])

Deletes all events.

download_file(→ io.BytesIO | None)

get_event_dates(→ tuple[datetime.datetime, ...)

Get the start and end datetime of an event in a seantis.dir.events

import_json(→ Callable[[CoreRequest, Framework], None])

Fetches the events from a seantis.dir.events instance.

filter_cb(→ dict[str, list[str]] | None)

import_ical(, keyword_filters, ...)

Imports events from an iCalendar file.

import_guidle(→ Callable[[CoreRequest, Framework], None])

Fetches the events from guidle.

Module Contents

event.cli.cli[source]
event.cli.clear(group_context: onegov.core.cli.core.GroupContext) Callable[[CoreRequest, Framework], None][source]

Deletes all events.

onegov-event –select ‘/veranstaltungen/zug’ clear

event.cli.download_file(file_url: str, size_limit: int = 1 * 1024 * 1024) io.BytesIO | None[source]
event.cli.get_event_dates(url: str, timezone: str) tuple[datetime.datetime, datetime.datetime][source]

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

event.cli.import_json(group_context: onegov.core.cli.core.GroupContext, url: str, tagmap_file: TextIOWrapper | None, clear: bool) Callable[[CoreRequest, Framework], None][source]

Fetches the events from a seantis.dir.events instance.

This command is intended for migration and to be removed in the future.

Example:

onegov-event –select ‘/veranstaltungen/zug’ import-json ‘https://veranstaltungen.zug.ch/veranstaltungen/?type=json&compact

event.cli.filter_cb(ctx: click.Context, param: click.Parameter, value: tuple[str, list[str]] | None) dict[str, list[str]] | None[source]
event.cli.import_ical(group_context: onegov.core.cli.core.GroupContext, ical: io.TextIOWrapper, future_events_only: bool = False, event_image: FileIO | None = None, categories: Sequence[str] = (), keyword_filters: dict[str, list[str]] | None = None) Callable[[CoreRequest, Framework], None][source]

Imports events from an iCalendar file.

Example:

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 -f “kalender” “Sport,Veranstaltungskalender”

event.cli.import_guidle(group_context: onegov.core.cli.core.GroupContext, url: str, tagmap_file: TextIOWrapper | None, clear: bool) Callable[[CoreRequest, Framework], None][source]

Fetches the events from guidle.

Example:

onegov-event –select ‘/veranstaltungen/zug’ import-guidle ‘http://www.guidle.com/xxxx/