Schedule with Docstrings
Project description
DocCron
Schedule with Docstrings
License | Version | ||
Travis CI | Coverage | ||
AppVeyor | Supported versions | ||
Wheel | Implementation | ||
Status | 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.0.tar.gz
(5.8 kB
view hashes)
Built Distribution
Close
Hashes for DocCron-1.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cc88f284fd5a387d1d2240e33e7391a6f25c6f57fa81ea6065964cffb950ded0 |
|
MD5 | df0a5319caeff95e54c56f69efde0d0e |
|
BLAKE2b-256 | f2a7c3af8b406d0eb9fa57ea1ef618a86c6e8706be58536116024fc0a37ef7e0 |