🕐 handcron 💁
Python task queue with manual ticks
Unlike a traditional task queue, handcron is designed to process
due tasks and then stop - by default, there is no long-running process in the background.
Instead, you periodically run handcron tick yourself (from a cron, etc.).
It is similar to django-cron and anacron(8), but comes as a simple Python library with Huey-inspired API.
Installation
Simply uv add handcron or pip install handcron.
If you'd like to use PostgreSQL as your storage backend, install the postgres extra:
uv add handcron[postgres] or pip install handcron[postgres].
Example
# my_tasks.py
from handcron import SqliteHandcron
cron = SqliteHandcron("handcron.sqlite")
@cron.periodic_task("@daily")
def my_task():
print("Hello from my task")
$ handcron tick my_tasks.cron # drain the queue once and exit
$ handcron serve my_tasks.cron # drain the queue periodically
$ handcron oneshot my_tasks.cron my_task # run a task without scheduling
$ handcron describe my_tasks.cron # print task schedule and last run status
INFO handcron.cli: Summary of instance 'handcron':
┌──────────┬─────────┬──────────────────────────────┬──────────────┬────────────┐
│ task │ cron │ last run │ start_date │ end_date │
├──────────┼─────────┼──────────────────────────────┼──────────────┼────────────┤
│ my_task │ @daily │ SUCCESS 2026-09-25 18:55:21 │ │ │
└──────────┴─────────┴──────────────────────────────┴──────────────┴────────────┘
handcron vs. alternatives
Celery, Huey, Apache Airflow
- handcron is much less resource intensive, since it works more like a serverless function than a background service. It won't prevent your CPU from entering a low-power state; the machine could even be turned off most of the time.
- handcron has no heavy dependencies and is easily run natively on Windows or Linux.
With uv, your scheduled command can be as simple as:
uv run --with handcron handcron tick my_tasks.cron
Plain cron(8), Systemd timer + service
- handcron can catch up with missed task runs, unlike cron(8).
- handcron keeps a database of past runs and their status, it has better visibility than flat logs.
- handcron allows you to define tasks on different schedules in one place.
License
MIT – see LICENSE.txt.
Metadata
Release files for handcron 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| handcron-0.1.0.tar.gz | 15.7 kB | Without provenance | Details for handcron-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| handcron-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for handcron-0.1.0-py3-none-any.whl |
Total release size: 35.2 kB
Release files / handcron-0.1.0.tar.gz
| Download URL | handcron-0.1.0.tar.gz |
|---|---|
| Size | 15.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
005b7653771ad3acdd3a8148c19892bb52f3579be63bef190d1eab403e31b252
|
|
BLAKE2b-256 checksum How to use checksums |
70d16aa570cd3d60d31e92834c2ae60712426c09d31cc14eb1760fd16312b80c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.6 {"installer":{"name":"uv","version":"0.12.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / handcron-0.1.0-py3-none-any.whl
| Download URL | handcron-0.1.0-py3-none-any.whl |
|---|---|
| Size | 19.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e2b45743cc9a74a6d36ac982911ea59e7da4fb6664533500106a8acb79f608e6
|
|
BLAKE2b-256 checksum How to use checksums |
e613c04b7d76673b2ec51ee08201c33772e1a10f6b69f988395433e8f639a440
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.6 {"installer":{"name":"uv","version":"0.12.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for handcron 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.