Schedule with Docstrings
Project description
DocCron
Schedule with Docstrings
License | Version | ||
Travis CI | Coverage | ||
AppVeyor | Supported versions | ||
Wheel | Implementation | ||
Status | Downloads | ||
Show your support |
Installation
pip install DocCron
Description
Cron-based scheduler inspired by doctest
Example
Standard/Extended Format
Run hello()
at every 2nd minute and 3rd minute:
import time
def hello():
"""
*/2 * * * *
*/3 * * * *
"""
print(time.strftime('%Y-%m-%d %H:%M:%S'), "hello world")
if __name__ == '__main__':
import doccron
doccron.run_jobs()
Quartz Format
Run hello()
at every 2nd second and 3rd second:
import time
def hello():
"""
*/2 * * * * *
*/3 * * * * *
"""
print(time.strftime('%Y-%m-%d %H:%M:%S'), "hello world")
if __name__ == '__main__':
import doccron
doccron.run_jobs(quartz=True)
Features
- Standard and extended cron formats (see CRON Expression)
- Nonstandard predefined scheduling definitions
- Non-standard characters
- Quartz format
- Human readable date/time strings
Open to ideas!
This is just a rough implementation of the concept! There are things that might need attention in the future:
- Mixing cron syntax with docstrings equivalent to what doctest is using (>>>))
- Timezone-awareness
References
Author
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
DocCron-1.1.2.tar.gz
(5.9 kB
view hashes)
Built Distribution
Close
Hashes for DocCron-1.1.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a3193639615bc59e3f10d7e1bb76250718014ce11f78ec5af246c68e23f6a2b7 |
|
MD5 | 65770eada8d6988eb68689b1666f21ad |
|
BLAKE2b-256 | dc69c5dbd34180024c1527c8eab09b3fb7d7bd2cb343f71b1b7cfa07b9d96ae0 |