Skip to main content

Lightweight persistent job scheduler for Python

Project description

whenly

PyPI version Python versions License: MIT

Lightweight persistent job scheduler for Python — SQLite-backed, minimal dependencies.

from whenly import Scheduler

s = Scheduler()

@s.every(5, minutes)
def sync_data():
    ...

@s.cron("0 9 * * MON")
def weekly_report():
    ...

s.start()  # background thread

Features

  • SQLite persistence — jobs survive restarts
  • Cron expressions via croniter
  • Interval scheduling — every N seconds/minutes/hours
  • One-off delayed jobs — run once after a delay
  • Decorator or programmatic API
  • Thread-safe background runner
  • CLI for basic management
  • Zero external dependencies (except croniter for cron support)

Install

pip install whenly

Quick Start

from whenly import Scheduler

s = Scheduler()

# Interval jobs
@s.every(30, seconds)
def poll_api():
    print("Polling...")

# Cron jobs
@s.cron("0 */2 * * *")
def cleanup():
    print("Running cleanup...")

# One-off delayed job
s.later(10, minutes, send_notification, msg="Hello")

# Start the scheduler (non-blocking)
s.start()

# Or run blocking
# s.run()

Programmatic API

s.add_job("poll", interval=60, unit="seconds", fn=poll_api)
s.add_job("cleanup", cron="0 3 * * *", fn=cleanup)
s.remove_job("poll")
s.list_jobs()

CLI

whenly list
whenly run

License

MIT


Part of the thecliffhanger open source suite.

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

whenly-0.2.0.tar.gz (25.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

whenly-0.2.0-py3-none-any.whl (12.0 kB view details)

Uploaded Python 3

File details

Details for the file whenly-0.2.0.tar.gz.

File metadata

  • Download URL: whenly-0.2.0.tar.gz
  • Upload date:
  • Size: 25.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.5

File hashes

Hashes for whenly-0.2.0.tar.gz
Algorithm Hash digest
SHA256 83f6c09863f160cd1e6b893147887caa5c55da03c3491ba0275f04cc56993f2f
MD5 f7b84ad2fc0cdcf6e325c741c90493bd
BLAKE2b-256 2bdf42fa00fd1d832e9179f343dbc7f6fdd97f70c185119a16ce17e6def35c16

See more details on using hashes here.

File details

Details for the file whenly-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: whenly-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 12.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.5

File hashes

Hashes for whenly-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 572926f23a5bbaa8404ef43cda98f439062c13d51591c9bc0a158e05649005cd
MD5 e051830c5e7fa8af38ee0e183d71b2bc
BLAKE2b-256 2c30e5702b3fce87cf746357c7b68e701227166f4b967b6b89d3e4278e8f8e6e

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