Skip to main content

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

Uploaded Source

File details

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

File metadata

  • Download URL: pyeasycron-0.1.3.1.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

Hashes for pyeasycron-0.1.3.1.tar.gz
Algorithm Hash digest
SHA256 4d1eedcafb1762cc1df15e1a96efb5b8da30252158246efd1b417d3f81d4c7d0
MD5 669e386ee2248a7e3a52e6ed5fba36ec
BLAKE2b-256 99b4046e7cf04d93f3a3b2f38a5997329c39f69ac062f5e34913c705ae95e348

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