Package: scheduler
A simple in-process python scheduler library with asyncio, threading and timezone support.
Schedule tasks by their time cycles, fixed times, weekdays, dates, weights, offsets and execution
counts and automate Jobs.FeaturesEasy and user friendly in-process Job scheduling(Quick Start)Asyncio scheduler(Example)Threading scheduler(Example)Timezone compatibility(Example)Passing of parameters(Example)Job prioritizationDefault linear prioritization(Example)User definable prioritization functions(Guide)Job tagging(Example)Job batching(Example)Job metadata(Example)LightweightHigh test coverageOnline documentationInstallationpipschedulercan be installed directly from the PyPI repositories with:pipinstallschedulerAlternatively installschedulerfrom thegitrepositorywith:gitclonehttps://gitlab.com/DigonIO/scheduler.gitcdscheduler
pipinstall.Arch LinuxThePKGBUILDfile can be utilized from theArch Build System.
Download thePKGBUILDfile and from within the containing folder runmakepkg -iExample:How to schedule JobsThe following example shows how theScheduleris instantiated and how basicJobs are created.
For advanced scheduling examples please visit the onlinedocumentation.importdatetimeasdtfromschedulerimportSchedulerfromscheduler.triggerimportMonday,Tuesdaydeffoo():print("foo")schedule=Scheduler()schedule.cyclic(dt.timedelta(minutes=10),foo)schedule.minutely(dt.time(second=15),foo)schedule.hourly(dt.time(minute=30,second=15),foo)schedule.daily(dt.time(hour=16,minute=30),foo)schedule.weekly(Monday(),foo)schedule.weekly(Monday(dt.time(hour=16,minute=30)),foo)schedule.once(dt.timedelta(minutes=10),foo)schedule.once(Tuesday(),foo)schedule.once(dt.datetime(year=2022,month=2,day=15,minute=45),foo)A human readable overview of the scheduled jobs can be created with a simpleprintstatement:print(schedule)max_exec=inf, tzinfo=None, priority_function=linear_priority_function, #jobs=9

type     function / alias due at                 due in      attempts weight
-------- ---------------- ------------------- --------- ------------- ------
MINUTELY foo()            2021-05-26 03:55:15   0:00:14         0/inf      1
CYCLIC   foo()            2021-05-26 04:05:00   0:09:59         0/inf      1
ONCE     foo()            2021-05-26 04:05:00   0:09:59           0/1      1
HOURLY   foo()            2021-05-26 04:30:15   0:35:14         0/inf      1
DAILY    foo()            2021-05-26 16:30:00  12:34:59         0/inf      1
WEEKLY   foo()            2021-05-31 00:00:00    4 days         0/inf      1
WEEKLY   foo()            2021-05-31 16:30:00    5 days         0/inf      1
ONCE     foo()            2021-06-01 00:00:00    5 days           0/1      1
ONCE     foo()            2022-02-15 00:45:00  264 days           0/1      1Executing pendingJobs periodically can be achieved with a simple loop:importtimewhileTrue:schedule.exec_jobs()time.sleep(1)DocumentationView the API documentationonline.SponsorWe would like to thank Digon.IO for sponsoring the development of this library.
Digon.IO is building bridges between data science and software development.
They enable companies to automate and accelerate their data-driven processes.
Please visit their website:digon.ioLicenseThis free and open source software (FOSS) is published under theLGPLv3 license.