Skip to main content

A simple job scheduler with cron expression

Inspired by “schedule”.

Usage

$ pip3 install scheduler-cron
import scheduler

def test_1():
    print('test1')

def test_2(name):
    print('test2: ' + name)

def test_3(name, lname):
    print('test3: ' + name + ' ' + lname)

scheduler = Scheduler(60)
scheduler.add('foo', '* * * * *', test_1)
scheduler.add('bar', '0/2 * * * *', test_2, ('mehrdad',))
scheduler.add('bas', '0/3 * * * *', test_3, ('behzad', 'mahmoudi'))
scheduler.add('zoo', '0/4 * * * *', test_3, ('reza', 'mahmoudi'))
scheduler.start()

ToDo

  • Run jobs in async mode

  • sleep for more than interval seconds if there is no jobs for next run

Meta

Mehrdad Mahmoudi - @mehrdadmhd - mehrdadmhd@gmail.com

https://github.com/mehrdadmhd/scheduler-py

Metadata

Release files for scheduler-cron 0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for scheduler-cron 0.1
File Size Uploaded
scheduler-cron-0.1.tar.gz 2.2 kB Details

Release files / scheduler-cron-0.1.tar.gz

Download URL scheduler-cron-0.1.tar.gz
Size 2.2 kB
Tags Source
SHA-256 checksum
How to use checksums
ea6307fdbc3cd47ae489a544aa834d53f0fa001eae6de416b95ffd4f2f265f77
BLAKE2b-256 checksum
How to use checksums
2db0d23c370be8de10f3b14f003a67a0cb447a84ff8ef083660d612529ec5e89
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.5

Release history Release notifications | RSS feed

This release

0.1 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page