prefect.schedules
This module contains functionality for creating schedules for deployments.
Functions
Cron
cron
: A valid cron string (e.g. “0 0 * * *”).timezone
: A valid timezone string in IANA tzdata format (e.g. America/New_York).day_or
: Control howday
andday_of_week
entries are handled. Defaults to True, matching cron which connects those values using OR. If the switch is set to False, the values are connected using AND. This behaves like fcron and enables you to e.g. define a job that executes each 2nd friday of a month by setting the days of month and the weekday.active
: Whether or not the schedule is active.parameters
: A dictionary containing parameter overrides for the schedule.slug
: A unique identifier for the schedule.
- A cron schedule.
Interval
interval
: The interval to use for the schedule. If an integer is provided, it will be interpreted as seconds.anchor_date
: The anchor date to use for the schedule.timezone
: A valid timezone string in IANA tzdata format (e.g. America/New_York).active
: Whether or not the schedule is active.parameters
: A dictionary containing parameter overrides for the schedule.slug
: A unique identifier for the schedule.
- An interval schedule.
RRule
rrule
: A valid RRule string (e.g. “RRULE:FREQ=DAILY;INTERVAL=1”).timezone
: A valid timezone string in IANA tzdata format (e.g. America/New_York).active
: Whether or not the schedule is active.parameters
: A dictionary containing parameter overrides for the schedule.slug
: A unique identifier for the schedule.
- An RRule schedule.
Classes
Schedule
A dataclass representing a schedule.
Note that only one of interval
, cron
, or rrule
can be defined at a time.