ORIONIS API REFERENCE

THE ORIONIS API

Build with clarity.

Explore the building blocks of an async-first Python framework. Every module, class, and method — connected, searchable, and ready to build with.

class documentation

Undocumented

Method __datetime Create a datetime instance from individual date and time components.
Method __init__ Initialize the Task instance.
Method coalesce Set the coalesce behavior for missed task executions.
Method cron Configure the task using a CRON-like expression.
Method daily Schedule the task to run once per day.
Method dailyAt Schedule the task to run daily at a specific hour, minute, and second.
Method endDate Set the end date for task execution.
Method entity Create and return a TaskEntity instance from the current Task.
Method every Configure the task to run at a custom interval.
Method everyDays Schedule to run at fixed intervals measured in days.
Method everyDaysAt Schedule to run every N days at a specific hour, minute, and second.
Method everyEightHours Schedule to run every eight hours.
Method everyEightHoursAt Schedule to run every eight hours at a specific minute and second.
Method everyElevenHours Schedule to run every eleven hours.
Method everyElevenHoursAt Schedule to run every eleven hours at a specific minute and second.
Method everyEvenHours Schedule the task to run at every even hour of the day.
Method everyFifteenMinutes Schedule the task to run every fifteen minutes.
Method everyFifteenMinutesAt Schedule to run every fifteen minutes at a specific second.
Method everyFifteenSeconds Schedule the task to run every fifteen seconds.
Method everyFiftyFiveMinutes Schedule the task to run every fifty-five minutes.
Method everyFiftyFiveMinutesAt Schedule the task to run every fifty-five minutes at a specific second.
Method everyFiftyFiveSeconds Schedule the task to run every fifty-five seconds.
Method everyFiftyMinutes Schedule to run every fifty minutes.
Method everyFiftyMinutesAt Schedule to run every fifty minutes at a specific second.
Method everyFiftySeconds Schedule the task to run every fifty seconds.
Method everyFiveDays Schedule to run every five days.
Method everyFiveDaysAt Schedule event to run every five days at a specific hour, minute, and second.
Method everyFiveHours Schedule the task to run every five hours.
Method everyFiveHoursAt Schedule to run every five hours at a specific minute and second.
Method everyFiveMinutes Schedule the task to run every five minutes.
Method everyFiveMinutesAt Schedule the task to run every five minutes at a specific second.
Method everyFiveSeconds Schedule the task to run every five seconds.
Method everyFortyFiveMinutes Schedule the task to run every forty-five minutes.
Method everyFortyFiveMinutesAt Schedule the task to run every forty-five minutes at a specific second.
Method everyFortyFiveSeconds Schedule the task to run every forty-five seconds.
Method everyFortyMinutes Schedule the task to run every forty minutes.
Method everyFortyMinutesAt Schedule to run every forty minutes at a specific second.
Method everyFortySeconds Schedule the task to run every forty seconds.
Method everyFourDays Schedule to run every four days.
Method everyFourDaysAt Schedule to run every four days at a specific hour, minute, and second.
Method everyFourHours Schedule the task to run every four hours.
Method everyFourHoursAt Schedule to run every four hours at a specific minute and second.
Method everyFridayAt Schedule the task to run every Friday at a specific hour, minute, and second.
Method everyHours Schedule the task to run at fixed intervals in hours.
Method everyHoursAt Schedule the task to run every N hours at a specific minute and second.
Method everyMinuteAt Schedule the task to run every minute at a specific second.
Method everyMinutes Schedule the task to run at fixed intervals in minutes.
Method everyMinutesAt Schedule to run at a specific second of every N-minute interval.
Method everyMondayAt Schedule event to run every Monday at a specific hour, minute, and second.
Method everyNineHours Schedule to run every nine hours.
Method everyNineHoursAt Schedule to run every nine hours at a specific minute and second.
Method everyOddHours Schedule the task to run at every odd hour of the day.
Method everySaturdayAt Schedule the task to run every Saturday at a specific hour, minute, and second.
Method everySeconds Schedule the task to run at fixed intervals in seconds.
Method everySevenDays Schedule the task to run every seven days.
Method everySevenDaysAt Schedule event to run every seven days at a specific hour, minute, and second.
Method everySevenHours Schedule to run every seven hours.
Method everySevenHoursAt Schedule to run every seven hours at a specific minute and second.
Method everySixDays Schedule the task to run every six days.
Method everySixDaysAt Schedule event to run every six days at a specific hour, minute, and second.
Method everySixHours Schedule to run every six hours.
Method everySixHoursAt Schedule to run every six hours at a specific minute and second.
Method everySundayAt Schedule the task to run every Sunday at a specific hour, minute, and second.
Method everyTenHours Schedule to run every ten hours.
Method everyTenHoursAt Schedule to run every ten hours at a specific minute and second.
Method everyTenMinutes Schedule to run every ten minutes.
Method everyTenMinutesAt Schedule to run every ten minutes at a specific second.
Method everyTenSeconds Schedule the task to run every ten seconds.
Method everyThirtyFiveMinutes Schedule to run every thirty-five minutes.
Method everyThirtyFiveMinutesAt Schedule to run every 35 minutes at a specific second.
Method everyThirtyFiveSeconds Schedule the task to run every thirty-five seconds.
Method everyThirtyMinutes Schedule the task to run every thirty minutes.
Method everyThirtyMinutesAt Schedule to run every thirty minutes at a specific second.
Method everyThirtySeconds Schedule the task to run every thirty seconds.
Method everyThreeDays Schedule to run every three days.
Method everyThreeDaysAt Schedule to run every three days at a specific hour, minute, and second.
Method everyThreeHours Schedule the task to run every three hours.
Method everyThreeHoursAt Schedule to run every three hours at a specific minute and second.
Method everyThursdayAt Schedule event to run every Thursday at a specific hour, minute, and second.
Method everyTuesdayAt Schedule event to run every Tuesday at a specific hour, minute, and second.
Method everyTwelveHours Schedule to run every twelve hours.
Method everyTwelveHoursAt Schedule to run every twelve hours at a specific minute and second.
Method everyTwentyFiveMinutes Schedule the task to run every twenty-five minutes.
Method everyTwentyFiveMinutesAt Schedule to run every twenty-five minutes at a specific second.
Method everyTwentyFiveSeconds Schedule the task to run every twenty-five seconds.
Method everyTwentyMinutes Schedule to run every twenty minutes.
Method everyTwentyMinutesAt Schedule to run every twenty minutes at a specific second.
Method everyTwentySeconds Schedule the task to run every twenty seconds.
Method everyTwoDays Schedule to run every two days.
Method everyTwoDaysAt Schedule to run every two days at a specific hour, minute, and second.
Method everyTwoHours Schedule the task to run every two hours.
Method everyTwoHoursAt Schedule to run every two hours at a specific minute and second.
Method everyWednesdayAt Schedule event to run every Wednesday at a specific hour, minute, and second.
Method everyWeeks Configure the task to run at fixed intervals measured in weeks.
Method hourly Schedule the task to run every hour.
Method hourlyAt Schedule the task to run every hour at a specific minute and second.
Method maxInstances Set the maximum number of concurrent task instances.
Method misfireGraceTime Set the misfire grace time in seconds.
Method on Register a callback for a specific task event.
Method onceAt Schedule the task to execute once at a specific date and time.
Method purpose Set the purpose or description for the scheduled command.
Method randomDelay Configure a random delay before task execution.
Method registerListener Register a task listener for task events.
Method startDate Set the start date for task execution.
Method weekly Schedule the task to run every week.
Constant _ERROR_MSG_INVALID_HOUR Undocumented
Constant _ERROR_MSG_INVALID_INTERVAL Undocumented
Constant _ERROR_MSG_INVALID_MINUTE Undocumented
Constant _ERROR_MSG_INVALID_SECOND Undocumented
Constant _LISTENER_METHODS_MAP Undocumented
Instance Variable __args Undocumented
Instance Variable __coalesce Undocumented
Instance Variable __default_tz Undocumented
Instance Variable __details Undocumented
Instance Variable __end_date Undocumented
Instance Variable __kwargs Undocumented
Instance Variable __listeners Undocumented
Instance Variable __max_instances Undocumented
Instance Variable __misfire_grace_time Undocumented
Instance Variable __purpose Undocumented
Instance Variable __random_delay Undocumented
Instance Variable __signature Undocumented
Instance Variable __start_date Undocumented
Instance Variable __trigger Undocumented
def __datetime(self, year: int, month: int, day: int, hour: int = 0, minute: int = 0, second: int = 0) -> datetime: (source)

Create a datetime instance from individual date and time components.

Validates all input parameters and constructs a datetime object using the provided year, month, day, hour, minute, and second values.

Parameters
year:intThe year component.
month:intThe month component (1-12).
day:intThe day component (1-31).
hour:int, optionalThe hour component (0-23). Default is 0.
minute:int, optionalThe minute component (0-59). Default is 0.
second:int, optionalThe second component (0-59). Default is 0.
Returns
datetimeA datetime instance constructed from the provided components.
Raises
TypeErrorIf year, month, day, hour, minute, or second are not integers.
ValueErrorIf hour, minute, or second are outside their valid ranges.
def __init__(self, signature: str, args: list[str] | None, kwargs: dict | None = None, purpose: str | None = None): (source)

Initialize the Task instance.

Set up the initial state of the Task, including its signature, arguments, purpose, and optional attributes such as random delay, start and end dates, trigger, details, listener, maximum instances, misfire grace time, and coalesce flag.

Parameters
signature:strUnique identifier for the task. Must be a non-empty string.
args:list of str or NoneList of arguments for the task. Defaults to an empty list if None.
kwargs:dict | NoneValue supplied for kwargs.
purpose:str or None, optionalHuman-readable description or purpose of the task.
Returns
NoneThis method does not return a value.
def coalesce(self, *, coalesce: bool = True) -> Self: (source)

Set the coalesce behavior for missed task executions.

Parameters
coalesce:bool, optionalIf True, only the most recent missed execution is run. If False, all missed executions are run in sequence. Default is True.
Returns
TaskThe current Task instance for method chaining.
def cron(self, year: str | None = None, month: str | None = None, day: str | None = None, week: str | None = None, day_of_week: str | None = None, hour: str | None = None, minute: str | None = None, second: str | None = None) -> bool: (source)

Configure the task using a CRON-like expression.

Parameters
year:str or None, optionalYear field for the cron expression.
month:str or None, optionalMonth field for the cron expression.
day:str or None, optionalDay field for the cron expression.
week:str or None, optionalWeek field for the cron expression.
day_of_week:str or None, optionalDay of week field for the cron expression.
hour:str or None, optionalHour field for the cron expression.
minute:str or None, optionalMinute field for the cron expression.
second:str or None, optionalSecond field for the cron expression.
Returns
boolReturn True if the cron scheduling was successfully configured.
Raises
ValueErrorIf all CRON parameters are None.
def daily(self) -> bool: (source)

Schedule the task to run once per day.

Configure the event to execute daily at midnight using a CronTrigger. Restrict the schedule with start_date and end_date if set. Apply random delay (jitter) if configured.

Returns
boolAlways returns True after configuring the daily schedule.
def dailyAt(self, hour: int, minute: int = 0, second: int = 0) -> bool: (source)

Schedule the task to run daily at a specific hour, minute, and second.

Validate input ranges for hour, minute, and second. Set up a CronTrigger for daily execution at the specified time. Store a description of the schedule.

Parameters
hour:intHour of the day in range [0, 23].
minute:int, optionalMinute of the hour in range [0, 59]. Default is 0.
second:int, optionalSecond of the minute in range [0, 59]. Default is 0.
Returns
boolTrue if the scheduling was successfully configured.
def endDate(self, year: int, month: int, day: int, hour: int = 0, minute: int = 0, second: int = 0) -> Self: (source)

Set the end date for task execution.

Parameters
year:intThe year component.
month:intThe month component (1-12).
day:intThe day component (1-31).
hour:int, optionalThe hour component (0-23). Default is 0.
minute:int, optionalThe minute component (0-59). Default is 0.
second:int, optionalThe second component (0-59). Default is 0.
Returns
SelfThe current Task instance for method chaining.
Raises
TypeErrorIf any date component is not an integer.
ValueErrorIf hour, minute, or second are outside their valid ranges.
def entity(self, random_delay: int | None = 0, max_instances: int | None = 1, misfire_grace_time: int | None = 0, *, coalesce: bool | None = True) -> TaskEntity: (source)

Create and return a TaskEntity instance from the current Task.

Collect all relevant attributes of the Task and encapsulate them in a TaskEntity object.

Notes

A per-task value explicitly configured through the fluent API (.maxInstances(), .coalesce(), .misfireGraceTime(), .randomDelay()) always takes precedence over the scheduler-level default received here. Using or instead of an explicit is not None check would silently discard the task override whenever the scheduler-level default is truthy (which it is for every field by default: coalesce=True, max_instances=1, misfire_grace_time=30), so that comparison must not be reintroduced.

Parameters
random_delay:int | None, optionalRandom delay in seconds before triggering. Defaults to 0.
max_instances:int | None, optionalMaximum concurrent instances allowed. Defaults to 1.
misfire_grace_time:int | None, optionalGrace period in seconds for misfired events. Defaults to 0.
coalesce:bool | None, optionalWhether to coalesce missed runs into a single run. Defaults to True.
Returns
TaskEntityThe TaskEntity instance containing the task's data.
Raises
ValueErrorIf signature or trigger is not set.
def every(self, weeks: int = 0, days: int = 0, hours: int = 0, minutes: int = 0, seconds: int = 0) -> bool: (source)

Configure the task to run at a custom interval.

Validates that all interval parameters are non-negative integers and that at least one is greater than zero. Sets up an IntervalTrigger with the specified intervals.

Parameters
weeks:int, optionalNumber of weeks between executions. Must be non-negative. Default is 0.
days:int, optionalNumber of days between executions. Must be non-negative. Default is 0.
hours:int, optionalNumber of hours between executions. Must be non-negative. Default is 0.
minutes:int, optionalNumber of minutes between executions. Must be non-negative. Default is 0.
seconds:int, optionalNumber of seconds between executions. Must be non-negative. Default is 0.
Returns
boolTrue if the scheduling was successfully configured.
Raises
ValueErrorIf any parameter is not a non-negative integer or if all are zero.
def everyDays(self, days: int) -> bool: (source)

Schedule to run at fixed intervals measured in days.

Validates that days is a positive integer. Sets up an IntervalTrigger with the specified interval in days, using any configured start and end dates, and random delay (jitter) if set.

Parameters
days:intValue supplied for days.
Returns
boolTrue if scheduling was configured successfully.
def everyDaysAt(self, days: int, hour: int, minute: int = 0, second: int = 0) -> bool: (source)

Schedule to run every N days at a specific hour, minute, and second.

Validates input ranges for days, hour, minute, and second. Sets up a CronTrigger for the specified interval and time. Returns True if scheduling was configured.

Parameters
days:intInterval in days. Must be a positive integer.
hour:intHour of the day in range [0, 23].
minute:int, optionalMinute of the hour in range [0, 59]. Default is 0.
second:int, optionalSecond of the minute in range [0, 59]. Default is 0.
Returns
boolTrue if scheduling was configured successfully.
def everyEightHours(self) -> bool: (source)

Schedule to run every eight hours.

Delegate scheduling to everyHours with an interval of eight hours. Return True if scheduling was configured.

Returns
boolAlways returns True after delegating scheduling to everyHours.
def everyEightHoursAt(self, minute: int, second: int = 0) -> bool: (source)

Schedule to run every eight hours at a specific minute and second.

Validate input ranges for minute and second. Delegate scheduling to everyHoursAt with an interval of eight hours and the specified time.

Parameters
minute:intMinute of the hour in range [0, 59].
second:int, optionalSecond of the minute in range [0, 59]. Default is 0.
Returns
boolReturns True if scheduling was configured successfully.
def everyElevenHours(self) -> bool: (source)

Schedule to run every eleven hours.

Delegates scheduling to everyHours with an interval of 11 hours. Returns True if scheduling was configured.

Returns
boolTrue if scheduling was configured.
def everyElevenHoursAt(self, minute: int, second: int = 0) -> bool: (source)

Schedule to run every eleven hours at a specific minute and second.

Validate input ranges for minute and second. Delegate scheduling to everyHoursAt with an interval of 11 hours and the specified time.

Parameters
minute:intMinute of the hour in range [0, 59].
second:int, optionalSecond of the minute in range [0, 59]. Default is 0.
Returns
boolReturns True if scheduling was configured successfully.
def everyEvenHours(self) -> bool: (source)

Schedule the task to run at every even hour of the day.

Configure the event to execute at every even-numbered hour using a CronTrigger. The schedule can be restricted by start_date and end_date. If a random delay (jitter) is set, it is applied to the trigger.

Returns
boolTrue if the scheduling was successfully configured.
def everyFifteenMinutes(self) -> bool: (source)

Schedule the task to run every fifteen minutes.

Set up an interval trigger for execution every fifteen minutes. The schedule can be limited by start_date and end_date. If a random delay (jitter) is set, it is applied to the trigger.

Returns
boolAlways returns True after configuring the interval trigger.
def everyFifteenMinutesAt(self, seconds: int) -> bool: (source)

Schedule to run every fifteen minutes at a specific second.

This method sets the event to execute at the given second (0-59) of every fifteen-minute interval. The schedule can be limited by start_date and end_date. Random delay (jitter) is not applied to this schedule, since it targets an exact second.

Parameters
seconds:intSecond (0-59) of each fifteen-minute interval.
Returns
boolReturns True if scheduling is configured successfully.
def everyFifteenSeconds(self) -> bool: (source)

Schedule the task to run every fifteen seconds.

Configure the event to execute at a fixed interval of fifteen seconds using an IntervalTrigger. The schedule can be restricted by start_date and end_date. If a random delay (jitter) is set, it is not applied.

Returns
boolAlways returns True after configuring the interval trigger.
def everyFiftyFiveMinutes(self) -> bool: (source)

Schedule the task to run every fifty-five minutes.

Configure the event to execute at a fixed interval of fifty-five minutes using an IntervalTrigger. The schedule can be restricted by start_date and end_date. If a random delay (jitter) is set, it is applied to the trigger.

Returns
boolAlways returns True after delegating scheduling to everyMinute.
def everyFiftyFiveMinutesAt(self, seconds: int) -> bool: (source)

Schedule the task to run every fifty-five minutes at a specific second.

Notes

This method delegates scheduling to everyMinutesAt with an interval of 55 minutes and the specified second.

Parameters
seconds:intThe specific second (0-59) of each fifty-five-minute interval at which the event should be executed.
Returns
boolReturn True if the scheduling was successfully configured.
def everyFiftyFiveSeconds(self) -> bool: (source)

Schedule the task to run every fifty-five seconds.

Configure the event to execute at a fixed interval of fifty-five seconds using an IntervalTrigger. The scheduling window can be restricted by start_date and end_date. If a random delay (jitter) is set, it is not applied.

Returns
boolAlways returns True after configuring the interval trigger.
def everyFiftyMinutes(self) -> bool: (source)

Schedule to run every fifty minutes.

Configures the event to execute at a fixed interval of fifty minutes using an IntervalTrigger. The schedule can be restricted by start_date and end_date. If a random delay (jitter) is set, it is applied to the trigger.

Returns
boolAlways returns True after delegating scheduling to everyMinute.
def everyFiftyMinutesAt(self, seconds: int) -> bool: (source)

Schedule to run every fifty minutes at a specific second.

Configures the event to execute at the specified second (0-59) of every fifty-minute interval. The scheduling window can be restricted by start_date and end_date. Random delay (jitter) is not applied to this schedule, since it targets an exact second.

Parameters
seconds:intSpecific second (0-59) of each fifty-minute interval.
Returns
boolReturns True if scheduling is configured successfully.
def everyFiftySeconds(self) -> bool: (source)

Schedule the task to run every fifty seconds.

Configure the event to execute at a fixed interval of fifty seconds using an IntervalTrigger. The scheduling window can be restricted by start_date and end_date. If a random delay (jitter) is set, it is not applied.

Returns
boolAlways returns True after configuring the interval trigger.
def everyFiveDays(self) -> bool: (source)

Schedule to run every five days.

Use the everyDays method with an interval of five days. The scheduling window can be restricted by start_date and end_date. If a random delay (jitter) is configured, it is applied to the trigger.

Returns
boolAlways returns True after delegating scheduling to everyDays.
def everyFiveDaysAt(self, hour: int, minute: int = 0, second: int = 0) -> bool: (source)

Schedule event to run every five days at a specific hour, minute, and second.

Validate input ranges for hour, minute, and second. Delegate scheduling to everyDaysAt with an interval of 5 days and the specified time.

Parameters
hour:intHour of the day in range [0, 23].
minute:int, optionalMinute of the hour in range [0, 59]. Default is 0.
second:int, optionalSecond of the minute in range [0, 59]. Default is 0.
Returns
boolReturns True if scheduling was configured successfully.
def everyFiveHours(self) -> bool: (source)

Schedule the task to run every five hours.

Use the everyHours method with an interval of five hours. The schedule can be restricted by start_date and end_date. If a random delay (jitter) is set, it will be applied to the trigger.

Returns
boolAlways returns True after delegating scheduling to everyHours.
def everyFiveHoursAt(self, minute: int, second: int = 0) -> bool: (source)

Schedule to run every five hours at a specific minute and second.

Validates input ranges for minute and second. Delegates scheduling to everyHoursAt with an interval of five hours and the specified time.

Parameters
minute:intMinute of the hour in range [0, 59].
second:int, optionalSecond of the minute in range [0, 59]. Default is 0.
Returns
boolReturns True if scheduling was configured successfully.
def everyFiveMinutes(self) -> bool: (source)

Schedule the task to run every five minutes.

Configures the event to execute at a fixed interval of five minutes using an IntervalTrigger. The scheduling window can be restricted by start_date and end_date. Applies random delay (jitter) if set.

Returns
boolAlways returns True after configuring the interval trigger.
def everyFiveMinutesAt(self, seconds: int) -> bool: (source)

Schedule the task to run every five minutes at a specific second.

Set the event to execute at the specified second (0-59) of every five-minute interval. The scheduling window can be restricted by start_date and end_date. Random delay (jitter) is not applied to this schedule, since it targets an exact second.

Parameters
seconds:intSecond (0-59) of each five-minute interval.
Returns
boolTrue if scheduling is configured successfully.
def everyFiveSeconds(self) -> bool: (source)

Schedule the task to run every five seconds.

This method sets up the event to execute at a fixed interval of five seconds using an IntervalTrigger. The scheduling window can be limited by the start_date and end_date attributes if they are set. If a random delay (jitter) is configured, it will be applied to the trigger.

Returns
boolAlways returns True after configuring the interval trigger.
def everyFortyFiveMinutes(self) -> bool: (source)

Schedule the task to run every forty-five minutes.

Configure the event to execute at a fixed interval of forty-five minutes using an IntervalTrigger. The schedule can be restricted by start_date and end_date. If a random delay (jitter) is set, it is applied to the trigger.

Returns
boolAlways returns True after delegating scheduling to everyMinute.
def everyFortyFiveMinutesAt(self, seconds: int) -> bool: (source)

Schedule the task to run every forty-five minutes at a specific second.

Set up the event to execute at the given second (0-59) of every forty-five- minute interval. The schedule can be limited by start_date and end_date. Random delay (jitter) is not applied to this schedule, since it targets an exact second.

Parameters
seconds:intThe second (0-59) of each forty-five-minute interval to execute the event.
Returns
boolReturns True if the scheduling is configured successfully.
def everyFortyFiveSeconds(self) -> bool: (source)

Schedule the task to run every forty-five seconds.

Configures the event to execute at a fixed interval of forty-five seconds using an IntervalTrigger. The schedule can be limited by start_date and end_date. If a random delay (jitter) is set, it is not applied.

Returns
boolAlways returns True after configuring the interval trigger.
def everyFortyMinutes(self) -> bool: (source)

Schedule the task to run every forty minutes.

Configures the event to execute at a fixed interval of forty minutes using an IntervalTrigger. The schedule can be restricted by start_date and end_date. If a random delay (jitter) is set, it is applied to the trigger.

Returns
boolAlways returns True after delegating scheduling to everyMinute.
def everyFortyMinutesAt(self, seconds: int) -> bool: (source)

Schedule to run every forty minutes at a specific second.

Configures the event to execute at the specified second (0-59) of every forty-minute interval. The scheduling window can be restricted by start_date and end_date. Random delay (jitter) is not applied to this schedule, since it targets an exact second.

Parameters
seconds:intThe specific second (0-59) of each forty-minute interval.
Returns
boolReturns True if scheduling is configured successfully.
def everyFortySeconds(self) -> bool: (source)

Schedule the task to run every forty seconds.

Configure the event to execute at a fixed interval of forty seconds using an IntervalTrigger. The schedule can be restricted by start_date and end_date. If a random delay (jitter) is set, it is not applied.

Returns
boolAlways returns True after configuring the interval trigger.
def everyFourDays(self) -> bool: (source)

Schedule to run every four days.

Returns
boolAlways returns True after delegating scheduling to everyDays.
def everyFourDaysAt(self, hour: int, minute: int = 0, second: int = 0) -> bool: (source)

Schedule to run every four days at a specific hour, minute, and second.

Parameters
hour:intHour of the day in range [0, 23].
minute:int, optionalMinute of the hour in range [0, 59]. Default is 0.
second:int, optionalSecond of the minute in range [0, 59]. Default is 0.
Returns
boolReturns True if scheduling was configured successfully.
def everyFourHours(self) -> bool: (source)

Schedule the task to run every four hours.

Use the everyHours method with an interval of four hours. The schedule can be restricted by start_date and end_date. If a random delay (jitter) is set, it will be applied to the trigger.

Returns
boolAlways returns True after delegating scheduling to everyHours.
def everyFourHoursAt(self, minute: int, second: int = 0) -> bool: (source)

Schedule to run every four hours at a specific minute and second.

Validate input ranges for minute and second. Delegate scheduling to everyHoursAt with an interval of four hours and the specified time.

Parameters
minute:intMinute of the hour in range [0, 59].
second:int, optionalSecond of the minute in range [0, 59]. Default is 0.
Returns
boolReturns True if scheduling was configured successfully.
def everyFridayAt(self, hour: int, minute: int = 0, second: int = 0) -> bool: (source)

Schedule the task to run every Friday at a specific hour, minute, and second.

Validates input ranges for hour, minute, and second. Sets up a CronTrigger for Fridays at the specified time. Stores a description of the schedule.

Parameters
hour:intHour of the day (0-23).
minute:int, optionalMinute of the hour (0-59). Default is 0.
second:int, optionalSecond of the minute (0-59). Default is 0.
Returns
boolTrue if the scheduling was successfully configured.
def everyHours(self, hours: int) -> bool: (source)

Schedule the task to run at fixed intervals in hours.

Validate that hours is a positive integer. Set up an IntervalTrigger with the specified interval in hours, using any configured start and end dates, and random delay (jitter) if set.

Parameters
hours:intValue supplied for hours.
Returns
boolTrue if the scheduling was configured successfully.
def everyHoursAt(self, hours: int, minute: int, second: int = 0) -> bool: (source)

Schedule the task to run every N hours at a specific minute and second.

Validates input for hours, minute, and second. Sets up an IntervalTrigger with the specified interval and time.

Parameters
hours:intInterval in hours. Must be a positive integer.
minute:intMinute of the hour in [0, 59].
second:int, optionalSecond of the minute in [0, 59]. Default is 0.
Returns
boolTrue if scheduling was configured successfully.
Raises
ValueErrorIf any parameter is out of valid range or not an integer.
def everyMinuteAt(self, seconds: int) -> bool: (source)

Schedule the task to run every minute at a specific second.

Validate that seconds is an integer in [0, 59]. Set a CronTrigger to execute at the specified second of every minute. Ignore any previously set jitter.

Notes

The event will be triggered at the specified second of every minute.

Parameters
seconds:intThe second (0-59) of each minute to execute the event.
Returns
boolTrue if scheduling was configured successfully.
def everyMinutes(self, minutes: int) -> bool: (source)

Schedule the task to run at fixed intervals in minutes.

Validates that minutes is a positive integer. Sets an IntervalTrigger with the specified interval, using any configured start_date, end_date, and random delay (jitter) if set.

Parameters
minutes:intInterval in minutes. Must be a positive integer.
Returns
boolAlways returns True after configuring the interval trigger.
def everyMinutesAt(self, minutes: int, seconds: int) -> bool: (source)

Schedule to run at a specific second of every N-minute interval.

Validates input for minutes and seconds. Sets a CronTrigger to execute at the specified second of every N-minute interval. Returns True if scheduling is set.

Parameters
minutes:intInterval in minutes. Must be a positive integer.
seconds:intSecond of the minute (0-59).
Returns
boolTrue if scheduling was configured successfully.
Raises
ValueErrorIf minutes is not a positive integer or seconds is not in [0, 59].
def everyMondayAt(self, hour: int, minute: int = 0, second: int = 0) -> bool: (source)

Schedule event to run every Monday at a specific hour, minute, and second.

Validates input ranges for hour, minute, and second. Sets up a CronTrigger for Mondays at the specified time. Stores a description of the schedule.

Parameters
hour:intValue supplied for hour.
minute:intValue supplied for minute.
second:intValue supplied for second.
Returns
boolReturns True if the scheduling was successfully configured.
Raises
ValueErrorIf hour, minute, or second are not integers within their valid ranges.
def everyNineHours(self) -> bool: (source)

Schedule to run every nine hours.

Delegates scheduling to everyHours with an interval of nine hours. Returns True if scheduling was configured.

Returns
boolTrue if scheduling was configured.
def everyNineHoursAt(self, minute: int, second: int = 0) -> bool: (source)

Schedule to run every nine hours at a specific minute and second.

Validate input ranges for minute and second. Delegate scheduling to everyHoursAt with an interval of nine hours and the specified time.

Parameters
minute:intMinute of the hour in range [0, 59].
second:int, optionalSecond of the minute in range [0, 59]. Default is 0.
Returns
boolReturns True if scheduling was configured successfully.
def everyOddHours(self) -> bool: (source)

Schedule the task to run at every odd hour of the day.

Configure the event to execute at every odd-numbered hour using a CronTrigger. The schedule can be restricted by start_date and end_date. If a random delay (jitter) is set, it is applied to the trigger.

Returns
boolTrue if the scheduling was successfully configured.
def everySaturdayAt(self, hour: int, minute: int = 0, second: int = 0) -> bool: (source)

Schedule the task to run every Saturday at a specific hour, minute, and second.

Validate the input ranges for hour, minute, and second. Set up a CronTrigger for Saturdays at the specified time. Store a description of the schedule.

Parameters
hour:intHour of the day (0-23).
minute:int, optionalMinute of the hour (0-59). Default is 0.
second:int, optionalSecond of the minute (0-59). Default is 0.
Returns
boolTrue if the scheduling was successfully configured.
def everySeconds(self, seconds: int) -> bool: (source)

Schedule the task to run at fixed intervals in seconds.

Validate that seconds is a positive integer. Set an IntervalTrigger to run at the specified interval. If a random delay is set, raise an error. Return True if scheduling is configured.

Parameters
seconds:intInterval in seconds. Must be a positive integer.
Returns
boolTrue if scheduling was configured successfully.
Raises
ValueErrorIf seconds is not a positive integer or if random delay is set.
def everySevenDays(self) -> bool: (source)

Schedule the task to run every seven days.

Use the everyDays method with an interval of seven days. The scheduling window can be restricted by start_date and end_date. If a random delay (jitter) is configured, it is applied to the trigger.

Returns
boolTrue if the scheduling was successfully configured.
def everySevenDaysAt(self, hour: int, minute: int = 0, second: int = 0) -> bool: (source)

Schedule event to run every seven days at a specific hour, minute, and second.

Validate input ranges for hour, minute, and second. Delegate scheduling to everyDaysAt with an interval of 7 days and the specified time.

Parameters
hour:intHour of the day in range [0, 23].
minute:int, optionalMinute of the hour in range [0, 59]. Default is 0.
second:int, optionalSecond of the minute in range [0, 59]. Default is 0.
Returns
boolTrue if scheduling was configured successfully.
def everySevenHours(self) -> bool: (source)

Schedule to run every seven hours.

Use everyHours with an interval of seven hours. Restrict schedule with start_date and end_date if set. Apply random delay (jitter) if configured.

Returns
boolAlways returns True after delegating scheduling to everyHours.
def everySevenHoursAt(self, minute: int, second: int = 0) -> bool: (source)

Schedule to run every seven hours at a specific minute and second.

Validate input ranges for minute and second. Delegate scheduling to everyHoursAt with an interval of seven hours and the specified time.

Parameters
minute:intMinute of the hour in range [0, 59].
second:int, optionalSecond of the minute in range [0, 59]. Default is 0.
Returns
boolReturns True if scheduling was configured successfully.
def everySixDays(self) -> bool: (source)

Schedule the task to run every six days.

Use the everyDays method with an interval of six days. The scheduling window can be restricted by start_date and end_date. If a random delay (jitter) is configured, it is applied to the trigger.

Returns
boolReturns True if the scheduling was successfully configured.
def everySixDaysAt(self, hour: int, minute: int = 0, second: int = 0) -> bool: (source)

Schedule event to run every six days at a specific hour, minute, and second.

Validate input ranges for hour, minute, and second. Delegate scheduling to everyDaysAt with an interval of 6 days and the specified time.

Parameters
hour:intHour of the day in range [0, 23].
minute:int, optionalMinute of the hour in range [0, 59]. Default is 0.
second:int, optionalSecond of the minute in range [0, 59]. Default is 0.
Returns
boolReturns True if scheduling was configured successfully.
def everySixHours(self) -> bool: (source)

Schedule to run every six hours.

Delegates scheduling to everyHours with an interval of six hours. Returns True if scheduling was configured.

Returns
boolAlways returns True after delegating scheduling to everyHours.
def everySixHoursAt(self, minute: int, second: int = 0) -> bool: (source)

Schedule to run every six hours at a specific minute and second.

Validate input ranges for minute and second. Delegate scheduling to everyHoursAt with an interval of six hours and the specified time.

Parameters
minute:intMinute of the hour in range [0, 59].
second:int, optionalSecond of the minute in range [0, 59]. Default is 0.
Returns
boolReturns True if scheduling was configured successfully.
def everySundayAt(self, hour: int, minute: int = 0, second: int = 0) -> bool: (source)

Schedule the task to run every Sunday at a specific hour, minute, and second.

Validate input ranges for hour, minute, and second. Set up a CronTrigger for Sundays at the specified time. Store a description of the schedule.

Parameters
hour:intHour of the day (0-23).
minute:int, optionalMinute of the hour (0-59). Default is 0.
second:int, optionalSecond of the minute (0-59). Default is 0.
Returns
boolTrue if the scheduling was successfully configured.
def everyTenHours(self) -> bool: (source)

Schedule to run every ten hours.

Delegate scheduling to everyHours with an interval of ten hours. The scheduling window can be restricted by start_date and end_date. Applies random delay (jitter) if configured.

Returns
boolAlways returns True after delegating scheduling to everyHours.
def everyTenHoursAt(self, minute: int, second: int = 0) -> bool: (source)

Schedule to run every ten hours at a specific minute and second.

Validate input ranges for minute and second. Delegate scheduling to everyHoursAt with an interval of ten hours and the specified time.

Parameters
minute:intMinute of the hour in range [0, 59].
second:int, optionalSecond of the minute in range [0, 59]. Default is 0.
Returns
boolReturns True if scheduling was configured successfully.
def everyTenMinutes(self) -> bool: (source)

Schedule to run every ten minutes.

Configures the event to execute at a fixed interval of ten minutes using an IntervalTrigger. The scheduling window can be restricted by start_date and end_date. If a random delay (jitter) is set, it is applied to the trigger.

Returns
boolAlways returns True after configuring the interval trigger.
def everyTenMinutesAt(self, seconds: int) -> bool: (source)

Schedule to run every ten minutes at a specific second.

Configures the event to execute at the specified second (0-59) of every ten-minute interval. Ignores any previously set random delay (jitter). The scheduling window can be restricted by start_date and end_date.

Parameters
seconds:intThe second (0-59) of each ten-minute interval to execute the event.
Returns
boolReturns True if scheduling is configured successfully.
def everyTenSeconds(self) -> bool: (source)

Schedule the task to run every ten seconds.

Configure the event to execute at a fixed interval of ten seconds using an IntervalTrigger. The schedule can be limited by start_date and end_date. If a random delay (jitter) is set, it is not applied.

Returns
boolAlways returns True after configuring the interval trigger.
def everyThirtyFiveMinutes(self) -> bool: (source)

Schedule to run every thirty-five minutes.

This method sets the event to execute at a fixed interval of thirty-five minutes using an IntervalTrigger. The schedule can be limited by start_date and end_date. If a random delay (jitter) is set, it is applied to the trigger.

Returns
boolAlways returns True after delegating scheduling to everyMinute.
def everyThirtyFiveMinutesAt(self, seconds: int) -> bool: (source)

Schedule to run every 35 minutes at a specific second.

Notes

The event is triggered at the specified second of every 35-minute interval.

Parameters
seconds:intSecond (0-59) of each 35-minute interval to execute the event.
Returns
boolReturn True if scheduling is configured successfully.
Raises
ValueErrorIf seconds is not an integer between 0 and 59 (inclusive).
def everyThirtyFiveSeconds(self) -> bool: (source)

Schedule the task to run every thirty-five seconds.

Configures the event to execute at a fixed interval of thirty-five seconds using an IntervalTrigger. The schedule can be restricted by start_date and end_date. If a random delay (jitter) is set, it is not applied.

Returns
boolReturns True after configuring the interval trigger for execution every thirty-five seconds.
def everyThirtyMinutes(self) -> bool: (source)

Schedule the task to run every thirty minutes.

Configures the event to execute at a fixed interval of thirty minutes using an IntervalTrigger. The schedule can be restricted by start_date and end_date. If a random delay (jitter) is set, it is applied to the trigger.

Returns
boolAlways returns True after delegating scheduling to everyMinute.
def everyThirtyMinutesAt(self, seconds: int) -> bool: (source)

Schedule to run every thirty minutes at a specific second.

Configures the event to execute at the given second (0-59) of every thirty-minute interval. The schedule can be restricted by start_date and end_date. Random delay (jitter) is not applied to this schedule, since it targets an exact second.

Parameters
seconds:intSecond of each thirty-minute interval to execute the event.
Returns
boolReturns True if scheduling is configured successfully.
def everyThirtySeconds(self) -> bool: (source)

Schedule the task to run every thirty seconds.

Configures the event to execute at a fixed interval of thirty seconds using an IntervalTrigger. The schedule can be limited by start_date and end_date. If a random delay (jitter) is set, it is not applied.

Returns
boolAlways returns True after configuring the interval trigger.
def everyThreeDays(self) -> bool: (source)

Schedule to run every three days.

Delegates scheduling to everyDays with an interval of 3 days. Returns True.

Returns
boolTrue if scheduling was configured successfully.
def everyThreeDaysAt(self, hour: int, minute: int = 0, second: int = 0) -> bool: (source)

Schedule to run every three days at a specific hour, minute, and second.

Validates input ranges for hour, minute, and second. Delegates scheduling to everyDaysAt with an interval of 3 days and the specified time.

Parameters
hour:intHour of the day in range [0, 23].
minute:int, optionalMinute of the hour in range [0, 59]. Default is 0.
second:int, optionalSecond of the minute in range [0, 59]. Default is 0.
Returns
boolReturns True if scheduling was configured successfully.
def everyThreeHours(self) -> bool: (source)

Schedule the task to run every three hours.

Use the everyHours method with an interval of three hours. The schedule can be restricted by start_date and end_date. If a random delay (jitter) is set, it will be applied to the trigger.

Returns
boolAlways returns True after delegating scheduling to everyHours.
def everyThreeHoursAt(self, minute: int, second: int = 0) -> bool: (source)

Schedule to run every three hours at a specific minute and second.

Set up the event to execute every three hours at the given minute and second. The schedule can be limited by start_date and end_date. Jitter is not used.

Parameters
minute:intMinute of the hour in [0, 59].
second:int, optionalSecond of the minute in [0, 59]. Default is 0.
Returns
boolTrue if scheduling is configured successfully.
def everyThursdayAt(self, hour: int, minute: int = 0, second: int = 0) -> bool: (source)

Schedule event to run every Thursday at a specific hour, minute, and second.

Validates input ranges for hour, minute, and second. Sets up a CronTrigger for Thursdays at the specified time. Stores a description of the schedule.

Parameters
hour:intHour of the day (0-23).
minute:int, optionalMinute of the hour (0-59). Default is 0.
second:int, optionalSecond of the minute (0-59). Default is 0.
Returns
boolTrue if the scheduling was successfully configured.
def everyTuesdayAt(self, hour: int, minute: int = 0, second: int = 0) -> bool: (source)

Schedule event to run every Tuesday at a specific hour, minute, and second.

Validates input ranges for hour, minute, and second. Sets up a CronTrigger for Tuesdays at the specified time. Stores a description of the schedule.

Parameters
hour:intHour of the day (0-23).
minute:int, optionalMinute of the hour (0-59). Default is 0.
second:int, optionalSecond of the minute (0-59). Default is 0.
Returns
boolTrue if the scheduling was successfully configured.
def everyTwelveHours(self) -> bool: (source)

Schedule to run every twelve hours.

Delegates scheduling to everyHours with an interval of 12 hours. The scheduling window can be restricted by start_date and end_date. Applies random delay (jitter) if configured.

Returns
boolAlways returns True after delegating scheduling to everyHours.
def everyTwelveHoursAt(self, minute: int, second: int = 0) -> bool: (source)

Schedule to run every twelve hours at a specific minute and second.

Validate input ranges for minute and second. Delegate scheduling to everyHoursAt with an interval of 12 hours and the specified time.

Parameters
minute:intMinute of the hour in range [0, 59].
second:int, optionalSecond of the minute in range [0, 59]. Default is 0.
Returns
boolReturns True if scheduling was configured successfully.
def everyTwentyFiveMinutes(self) -> bool: (source)

Schedule the task to run every twenty-five minutes.

Configures the event to execute at a fixed interval of twenty-five minutes using an IntervalTrigger. The scheduling window can be restricted by start_date and end_date. If a random delay (jitter) is set, it is applied to the trigger.

Returns
boolAlways returns True after delegating scheduling to everyMinute.
def everyTwentyFiveMinutesAt(self, seconds: int) -> bool: (source)

Schedule to run every twenty-five minutes at a specific second.

Set up the event to execute at the given second (0-59) of every twenty-five- minute interval. The schedule can be limited by start_date and end_date.

Parameters
seconds:intSecond (0-59) of each twenty-five-minute interval.
Returns
boolReturns True if scheduling is configured successfully.
def everyTwentyFiveSeconds(self) -> bool: (source)

Schedule the task to run every twenty-five seconds.

Configure the event to execute at a fixed interval of twenty-five seconds using an IntervalTrigger. The schedule can be restricted by start_date and end_date. If a random delay (jitter) is set, it is not applied.

Returns
boolAlways returns True after configuring the interval trigger.
def everyTwentyMinutes(self) -> bool: (source)

Schedule to run every twenty minutes.

This method sets the event to execute at a fixed interval of twenty minutes using an IntervalTrigger. The schedule can be limited by start_date and end_date. If a random delay (jitter) is set, it is applied to the trigger.

Returns
boolAlways returns True after delegating scheduling to everyMinute.
def everyTwentyMinutesAt(self, seconds: int) -> bool: (source)

Schedule to run every twenty minutes at a specific second.

Configures the event to execute at the specified second (0-59) of every twenty-minute interval. The schedule can be restricted by start_date and end_date. Random delay (jitter) is not applied to this schedule, since it targets an exact second.

Parameters
seconds:intSecond (0-59) of each twenty-minute interval.
Returns
boolReturns True if scheduling is configured successfully.
def everyTwentySeconds(self) -> bool: (source)

Schedule the task to run every twenty seconds.

Configures the event to execute at a fixed interval of twenty seconds using an IntervalTrigger. The schedule can be restricted by start_date and end_date. If a random delay (jitter) is set, it is not applied.

Returns
boolAlways returns True after configuring the interval trigger.
def everyTwoDays(self) -> bool: (source)

Schedule to run every two days.

Delegates scheduling to everyDays with an interval of 2 days.

Returns
boolAlways returns True after delegating scheduling to everyDays.
def everyTwoDaysAt(self, hour: int, minute: int = 0, second: int = 0) -> bool: (source)

Schedule to run every two days at a specific hour, minute, and second.

Validate input ranges for hour, minute, and second. Delegate scheduling to everyDaysAt with an interval of 2 days and the specified time.

Parameters
hour:intHour of the day in range [0, 23].
minute:int, optionalMinute of the hour in range [0, 59]. Default is 0.
second:int, optionalSecond of the minute in range [0, 59]. Default is 0.
Returns
boolReturns True if scheduling was configured successfully.
def everyTwoHours(self) -> bool: (source)

Schedule the task to run every two hours.

Use the everyHours method with an interval of two hours. The schedule can be restricted by start_date and end_date. If a random delay (jitter) is set, it will be applied to the trigger.

Returns
boolAlways returns True after delegating scheduling to everyHours.
def everyTwoHoursAt(self, minute: int, second: int = 0) -> bool: (source)

Schedule to run every two hours at a specific minute and second.

Validate input ranges for minute and second. Delegate scheduling to everyHoursAt with an interval of two hours and the specified time.

Parameters
minute:intMinute of the hour in range [0, 59].
second:int, optionalSecond of the minute in range [0, 59]. Default is 0.
Returns
boolTrue if scheduling was configured successfully.
def everyWednesdayAt(self, hour: int, minute: int = 0, second: int = 0) -> bool: (source)

Schedule event to run every Wednesday at a specific hour, minute, and second.

Validates input ranges for hour, minute, and second. Sets up a CronTrigger for Wednesdays at the specified time. Stores a description of the schedule.

Parameters
hour:intHour of the day (0-23).
minute:int, optionalMinute of the hour (0-59). Default is 0.
second:int, optionalSecond of the minute (0-59). Default is 0.
Returns
boolTrue if the scheduling was successfully configured.
def everyWeeks(self, weeks: int) -> bool: (source)

Configure the task to run at fixed intervals measured in weeks.

Validates that the weeks parameter is a positive integer. Sets up an IntervalTrigger with the specified interval in weeks. Returns True if the scheduling was successfully configured.

Parameters
weeks:intNumber of weeks between executions. Must be a positive integer.
Returns
boolTrue if the scheduling was successfully configured.
Raises
ValueErrorIf weeks is not a positive integer.
def hourly(self) -> bool: (source)

Schedule the task to run every hour.

Configure the event to execute once every hour. The schedule starts from start_date and ends at end_date if set. If a random delay (jitter) is configured, it is applied to the trigger. The event is triggered at regular hourly intervals.

Returns
boolAlways returns True after configuring the interval trigger.
def hourlyAt(self, minute: int, second: int = 0) -> bool: (source)

Schedule the task to run every hour at a specific minute and second.

Validate that minute and second are integers within valid ranges. Set up an IntervalTrigger to execute the event every hour at the specified minute and second. Store a human-readable description of the schedule.

Parameters
minute:intMinute of the hour in the range [0, 59].
second:int, optionalSecond of the minute in the range [0, 59]. Default is 0.
Returns
boolTrue if the scheduling was successfully configured.
Raises
ValueErrorIf minute or second are not integers in valid ranges.
def maxInstances(self, max_instances: int) -> Self: (source)

Set the maximum number of concurrent task instances.

Parameters
max_instances:intMaximum number of concurrent instances. Must be a positive integer.
Returns
TaskThis instance for method chaining.
def misfireGraceTime(self, seconds: int = 60) -> Self: (source)

Set the misfire grace time in seconds.

Parameters
seconds:int, optionalNumber of seconds for the misfire grace period. Must be a positive integer greater than zero. Default is 60.
Returns
TaskThis instance for method chaining.
Raises
ValueErrorIf seconds is not a positive integer.
def on(self, event: TaskEvent, callback: Callable) -> Self: (source)

Register a callback for a specific task event.

Parameters
event:TaskEventThe event type to listen for.
callback:CallableThe function to call when the event occurs.
Returns
TaskThe current Task instance for method chaining.
Raises
ValueErrorIf event is not a TaskEvent or callback is not callable.
def onceAt(self, year: int, month: int, day: int, hour: int = 0, minute: int = 0, second: int = 0) -> bool: (source)

Schedule the task to execute once at a specific date and time.

Configure the task to run a single time at the specified date and time using the provided year, month, day, hour, minute, and second values. This sets both start and end dates to the specified datetime and uses a DateTrigger for one-time execution.

Parameters
year:intThe year component.
month:intThe month component (1-12).
day:intThe day component (1-31).
hour:int, optionalThe hour component (0-23). Default is 0.
minute:int, optionalThe minute component (0-59). Default is 0.
second:int, optionalThe second component (0-59). Default is 0.
Returns
boolTrue if the scheduling was configured successfully.
Raises
ValueErrorIf random delay is set or if date components are invalid.
TypeErrorIf any date component is not an integer.
def purpose(self, purpose: str) -> Self: (source)

Set the purpose or description for the scheduled command.

Parameters
purpose:strPurpose or description to associate with the scheduled command. Must be a non-empty string.
Returns
TaskThe current instance for method chaining.
Raises
ValueErrorIf the purpose is not a non-empty string.
def randomDelay(self, max_seconds: int = 10) -> Self: (source)

Configure a random delay before task execution.

Parameters
max_seconds:int, optionalMaximum delay in seconds before execution. Must be between 0 and 120. Default is 10.
Returns
TaskThe current Task instance for method chaining.
Raises
ValueErrorIf max_seconds is not an integer in [0, 120].
def registerListener(self, listener: BaseTaskListener) -> Self: (source)

Register a task listener for task events.

Parameters
listener:BaseTaskListenerListener instance implementing the BaseTaskListener interface.
Returns
SelfThe current Task instance for method chaining.
Raises
TypeErrorIf the listener does not implement BaseTaskListener.
def startDate(self, year: int, month: int, day: int, hour: int = 0, minute: int = 0, second: int = 0) -> Self: (source)

Set the start date for task execution.

Parameters
year:intThe year component.
month:intThe month component (1-12).
day:intThe day component (1-31).
hour:int, optionalThe hour component (0-23). Default is 0.
minute:int, optionalThe minute component (0-59). Default is 0.
second:int, optionalThe second component (0-59). Default is 0.
Returns
SelfThe current Task instance for method chaining.
Raises
TypeErrorIf any date component is not an integer.
ValueErrorIf hour, minute, or second are outside their valid ranges.
def weekly(self) -> bool: (source)

Schedule the task to run every week.

Configure the event to execute once per week on Sunday at 00:00:00. The schedule can be restricted by start_date and end_date. If a random delay (jitter) is configured, it is applied to the trigger.

Returns
boolTrue if the scheduling was successfully configured.
_ERROR_MSG_INVALID_HOUR: str = (source)

Undocumented

Value
'Hour must be between 0 and 23.'
_ERROR_MSG_INVALID_INTERVAL: str = (source)

Undocumented

Value
'Interval value must be a positive integer.'
_ERROR_MSG_INVALID_MINUTE: str = (source)

Undocumented

Value
'Minute must be between 0 and 59.'
_ERROR_MSG_INVALID_SECOND: str = (source)

Undocumented

Value
'Second must be between 0 and 59.'
_LISTENER_METHODS_MAP: ClassVar[dict[str, TaskEvent]] = (source)

Undocumented

Value
{'onTaskAdded': TaskEvent.ADDED,
 'onTaskRemoved': TaskEvent.REMOVED,
 'onTaskExecuted': TaskEvent.EXECUTED,
 'onTaskError': TaskEvent.ERROR,
 'onTaskMissed': TaskEvent.MISSED,
 'onTaskSubmitted': TaskEvent.SUBMITTED,
 'onTaskMaxInstances': TaskEvent.MAX_INSTANCES}

Undocumented

__coalesce: bool | None = (source)

Undocumented

__default_tz = (source)

Undocumented

__details: str | None = (source)

Undocumented

Undocumented

__kwargs: dict | None = (source)

Undocumented

__listeners: list[Callable] = (source)

Undocumented

__max_instances: int | None = (source)

Undocumented

__misfire_grace_time: int | None = (source)

Undocumented

__purpose: str | None = (source)

Undocumented

__random_delay: int | None = (source)

Undocumented

__signature: str = (source)

Undocumented

__start_date: datetime | None = (source)

Undocumented

__trigger: CronTrigger | DateTrigger | IntervalTrigger | None = (source)

Undocumented