Python job scheduling for humans.
An in-process scheduler for periodic jobs that uses the builder pattern for configuration. Schedule lets you run Python functions (or any other callable) periodically at pre-determined intervals using a simple, human-friendly syntax.
Inspired by Adam Wiggins’ article “Rethinking Cron” (Google cache) and the clockwork Ruby module.
Features
A simple to use API for scheduling jobs.
Very lightweight and no external dependencies.
Excellent test coverage.
Works with Python 2.7 and 3.3
Usage
$ pip install schedule
import schedule
import time
def job():
print("I'm working...")
schedule.every(10).minutes.do(job)
schedule.every().hour.do(job)
schedule.every().day.at("10:30").do(job)
while True:
schedule.run_pending()
time.sleep(1)
FAQ
In lieu of a full documentation (coming soon) check out this set of frequently asked questions for solutions to some common questions.
Meta
Daniel Bader – @dbader_org – mail@dbader.org
Distributed under the MIT license. See LICENSE.txt for more information.
History
0.2.0 (2013-11-09)
This release introduces two new features in a backwards compatible way:
Allow jobs to cancel repeated execution: Jobs can be cancelled by calling schedule.cancel_job() or by returning schedule.CancelJob from the job function. (Thanks to @cfrco and @matrixise.)
Updated at_time() to allow running jobs at a particular time every hour. Example: every().hour.at(':15').do(job) will run job every hour (Thanks @mattss.)
Refactored unit tests to mock datetime in a cleaner way. (Thanks @matts.)
0.1.11 (2013-07-30)
Fixed an issue with next_run() throwing a ValueError exception when the job queue is empty. Thanks to @dpagano for pointing this out and thanks to @mrhwick for quickly providing a fix.
0.1.10 (2013-06-07)
Fixed issue with at_time jobs not running on the same day the job is created (Thanks to @mattss)
0.1.9 (2013-05-27)
Added schedule.next_run()
Added schedule.idle_seconds()
Args passed into do() are forwarded to the job function at call time
Increased test coverage to 100%
0.1.8 (2013-05-21)
Changed default delay_seconds for schedule.run_all() to 0 (from 60)
Increased test coverage
0.1.7 (2013-05-20)
API change: renamed schedule.run_all_jobs() to schedule.run_all()
API change: renamed schedule.run_pending_jobs() to schedule.run_pending()
API change: renamed schedule.clear_all_jobs() to schedule.clear()
Added schedule.jobs
0.1.6 (2013-05-20)
Fix packaging
README fixes
0.1.4 (2013-05-20)
API change: renamed schedule.tick() to schedule.run_pending_jobs()
Updated README and setup.py packaging
0.1.0 (2013-05-19)
Initial release
Metadata
Release files for schedule 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| schedule-0.2.0.tar.gz | 7.5 kB | Without provenance | Details |
Release files / schedule-0.2.0.tar.gz
| Download URL | schedule-0.2.0.tar.gz |
|---|---|
| Size | 7.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fe77c7c7300a030ec700a3cb8d2c53dcb15e2d65a9f9ba058b0785900e367ff7
|
|
BLAKE2b-256 checksum How to use checksums |
1a9112d930126f9d732b1b097ed302d1384dd20ba3ea099d2dfc9fa33e3ac45d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for schedule 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.