Skip to main content

cronify

Lightweight background task scheduler for Python — no Celery needed


Install

pip install cronify

Usage

from cronify import Scheduler

scheduler = Scheduler()

@scheduler.every(minutes=5)
async def cleanup_expired_tokens():
    await db.execute("DELETE FROM tokens WHERE expires_at < now()")

@scheduler.every(hours=1, run_immediately=True)
async def sync_exchange_rates():
    rates = await fetch_rates()
    await cache.set("rates", rates)

# Start in your FastAPI app:
@app.on_event("startup")
async def startup():
    await scheduler.start()

Features

  • @scheduler.every(seconds=30) — decorator syntax
  • Async and sync functions supported
  • Error resilient — one failing job doesn't stop others
  • No Redis, no Celery, no external broker
  • Pure asyncio — works everywhere Python runs
  • run_immediately=True for instant first execution
  • Zero dependencies

API

scheduler.every(seconds=30)            # every 30 seconds
scheduler.every(minutes=5)             # every 5 minutes
scheduler.every(hours=1)               # every hour
scheduler.every(hours=1, minutes=30)   # every 1.5 hours
scheduler.every(seconds=10, run_immediately=True)  # run now, then every 10s

await scheduler.start()   # start all jobs
await scheduler.stop()    # cancel all jobs
scheduler.jobs             # list registered jobs

License

MIT

Release files for cronify-scheduler 0.1.0

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

Source distribution (sdist)

Source distribution for cronify-scheduler 0.1.0
File Size Uploaded
cronify_scheduler-0.1.0.tar.gz 4.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cronify-scheduler 0.1.0
File Interpreter ABI Platform
cronify_scheduler-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 8.0 kB

Release files / cronify_scheduler-0.1.0.tar.gz

Download URL cronify_scheduler-0.1.0.tar.gz
Size 4.0 kB
Tags Source
SHA-256 checksum
How to use checksums
cb2ef33fe4f84439927d59aa03d24fbf49542c656ffcaaecd029996f1fd792b9
BLAKE2b-256 checksum
How to use checksums
3634f662765fbfd2bf98f9760228c785c22e47b038583cdc609c567c21dd9728
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Release files / cronify_scheduler-0.1.0-py3-none-any.whl

Download URL cronify_scheduler-0.1.0-py3-none-any.whl
Size 4.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5527737b237b1c6756a3625136bd207a157c79ceeef6dbb0c35999963a34840d
BLAKE2b-256 checksum
How to use checksums
d4c1dd5d78b68e81f4cbaab344e66922a80072dcd07d8214c2cb3b6cf6e036bd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

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