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

Uploaded Source

File details

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

File metadata

  • Download URL: pyeasycron-0.1.1.tar.gz
  • Upload date:
  • Size: 3.2 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.1.tar.gz
Algorithm Hash digest
SHA256 71d36a2396d08d252e8c5655641e0e34bba24605072702f368289935982f53b6
MD5 460eb0f60b2284c5adb857f8fe7b0213
BLAKE2b-256 e53478b0356e66a56ad9c5e5dadd963373b79fc15f26c50f26ae66fbf92f6db1

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