An easy way to make function run as cron
Project description
pyeasycron
Brief Intro
An easy way to make function run as cron.
Installation
pip3 install pyeasycron
Usage
import easycron
from datetime import datetime
# Expected run when '*/2 * * * *' is satisfied
@easycron.cron('*/2 * * * *')
def func1():
print(f"in func1: {datetime.now()}")
# Expected run when one of ['*/5 8 * * *', '7,14,21 9 * * *'] is satisfied
@easycron.cron(['*/5 8 * * *', '7,14,21 9 * * *'])
def func2():
print(f"in func2: {datetime.now()}")
if __name__ == '__main__':
easycron.run()
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pyeasycron-0.1.3.tar.gz
(3.4 kB
view details)
File details
Details for the file pyeasycron-0.1.3.tar.gz.
File metadata
- Download URL: pyeasycron-0.1.3.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8c1b087768a613d770a028ea551602ec4a066f623c09a9ca2f5353bc93bf3454
|
|
| MD5 |
780c79fbe89998fd04de7c834b2379d4
|
|
| BLAKE2b-256 |
47625c21f507ebeddc6ef90331ff8dd21c2c2ea7560a0b70e1c1b749577e7d81
|