Schedule package that contains classes for working with schedules.


Variables

Constants


Types

Schedule

type

Data type that manages a collection of scheduling rules, allowing for specific times and exceptions to be defined.

Methods


ScheduleRule

type

Data type to represent a rule for a schedule, specifying the start and end times, along with the weekdays when the rule is active.

Methods

Example
# this rule applies from 9:00 AM to 6:30 PM (6:30 is not included) on weekdays (Monday through Friday).
rule = ScheduleRule(start=time(hour=9), end=time(hour=18, minute=30), days=WORKDAYS)
# this overnight_rule applies from 8:15 PM to 7:30 AM on weekdays (Monday through Friday).
overnight_rule = ScheduleRule(start=time(hour=20, minute=15), end=time(hour=7, minute=30), days=WORKDAYS)
For rules that span overnight (e.g., from 10:00 PM to 6:00 AM), the end time should be on the day listed in days, while the start time is understood to be on the previous day. This allows the rule to cover activities that occur late in the evening and extend into the early hours of the next day.

Enums

WeekDay

enum

Enum-like class with constants for days of week.

Static fields