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.1.tar.gz
(5.9 kB
view hashes)
Built Distribution
Close
Hashes for DocCron-1.1.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a1d4eb5291a6d2598bbeab692d777c8300e454784ff3c570aaa10b0fe701874d |
|
MD5 | f37b16c452455dea8b446cd4f637d08d |
|
BLAKE2b-256 | 9f0614f1874ecc76cfa7e783cf3cd0d1bfc6b1f03312d1918f218d54b28e3c4f |