Skip to main content

An easy way to make function run as cron

Project description

easycron

Brief Intro

An easy way to make function run as cron.

Installation

pip3 install easycron

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.0.tar.gz (3.1 kB view details)

Uploaded Source

File details

Details for the file pyeasycron-0.1.0.tar.gz.

File metadata

  • Download URL: pyeasycron-0.1.0.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.9

File hashes

Hashes for pyeasycron-0.1.0.tar.gz
Algorithm Hash digest
SHA256 661e97ee38d5600c81799970778b0171ef7be7f27d4b1263dbefceed4e802e55
MD5 7e762d33ed3670eb2829e925be1e91d3
BLAKE2b-256 a593a783171b2992bafad54017200718a60f9526f21fbf44582ae2df1114c080

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page