Skip to main content
Version: 1.9.1

CronTrigger

class CronTrigger(mask: str, start: datetime | None = None, end: datetime | None = None)

Categories: trigger

Represents a cron-based trigger for scheduling Tabsdata publishers, subscribers and transformers.

This class defines a trigger based on a cron expression, with optional start and end times to constrain its activation period. It validates the cron mask and time boundaries to ensure the trigger is well-formed.

Initializes a CronTrigger instance.

Parameters

parameter
mask

A cron expression string with 5 fields (minute, hour, day of month, month, day of week).

parameter
start

An optional timezone-aware datetime object indicating the earliest time the trigger can fire.

parameter
end

An optional timezone-aware datetime object indicating the latest time the trigger can fire.

Properties

property
endstr | None

Gets the end time of the trigger as a timezone-aware ISO 8601 string with 'Z' timezone.

Returns: The end time in ISO format, or None if not set.

property
maskstr

Gets the cron expression mask.

Returns: The cron expression string.

property
startstr | None

Gets the start time of the trigger as a timezone-aware ISO 8601 string with 'Z' timezone.

Returns: The start time in ISO format, or None if not set.