matrix-planner
Lightweight async task scheduler for Python 3.13+. Single dependency: croniter.
import asyncio
from matrix_planner import Planner, every
planner = Planner()
@planner.task(every("10s"))
def heartbeat() -> None:
print("tick")
@planner.task(
every("30s"),
max_retries=3,
backoff=lambda a: 2 ** a, # 2, 4, 8… seconds between retries
timeout="15s", # cancel and log if execution exceeds 15s
)
async def fetch() -> None:
...
planner.run_forever()
Key features
| Feature | API |
|---|---|
| Fixed-interval schedule | every("10s"), every(timedelta(minutes=5)) |
| Cron schedule | cron("*/5 * * * *") |
| One-shot schedule | once(datetime(2026, 12, 31)) |
| Decorator registration | @planner.task(every("2s")) |
| Manual registration | planner.add(Task(func=..., schedule=...)) |
| Retry policy | max_retries=N, backoff=float | Callable[[int], float] |
| Per-execution timeout | timeout="15s" | timedelta | float |
| Error callback | on_error=my_handler |
| Sync + async functions | sync dispatched via run_in_executor |
| Direct task invocation | task() bypasses scheduler (useful in tests) |
anchor="start" |
first tick interval after creation, steady cadence |
anchor="end" |
interval measured from end of each execution |
Schedules
# Every 10 seconds (first tick after 10s from now)
s = every("10s")
# Every 5 minutes, anchored to end of execution
s = every("5m", anchor="end")
# Cron expression (fires at 09:00 every weekday)
s = cron("0 9 * * 1-5")
# Cron with timezone
s = cron("0 9 * * *", tz=timezone.utc)
# Fire once at a specific datetime
s = once(datetime(2026, 12, 31, 23, 59))
Task parameters
Task(
func=my_fn,
schedule=every("10s"),
name="my-task", # defaults to func.__name__
args=(1, 2),
kwargs={"key": "val"},
max_retries=2,
backoff=1.0, # fixed delay, or lambda a: 2 ** a
timeout="15s", # None = no limit
on_error=lambda e: ..., # called instead of logging on failure
)
Requirements
Python 3.13+. Single dependency: croniter>=6.2.3.
Install: uv add matrix-planner or pip install matrix-planner.
Written with love by dotmatrix.
Metadata
Release files for matrix-planner 0.2.1
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 |
|---|---|---|---|---|
| matrix_planner-0.2.1.tar.gz | 9.7 kB | Without provenance | Details for matrix_planner-0.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| matrix_planner-0.2.1-py3-none-any.whl | Python 3 | none | any | Details for matrix_planner-0.2.1-py3-none-any.whl |
Total release size: 19.2 kB
Release files / matrix_planner-0.2.1.tar.gz
| Download URL | matrix_planner-0.2.1.tar.gz |
|---|---|
| Size | 9.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d18f4a92c0cad2cdb9423c0cdbeca9af6e9bb859027ec958ef65a757498edcf3
|
|
BLAKE2b-256 checksum How to use checksums |
eea9c11aa92d191d6f7d2eccdae981a49786f7e1ed1f9bd5e0746bf14fe6751b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","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 / matrix_planner-0.2.1-py3-none-any.whl
| Download URL | matrix_planner-0.2.1-py3-none-any.whl |
|---|---|
| Size | 9.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5e49e5898b42da4902bdd5ab2223eebde647a122cbbd5aea6752de4bcf863a99
|
|
BLAKE2b-256 checksum How to use checksums |
920e0ccfeedc18e2bdebd2e229bcef8a7e81e5c18c13cdd872d896d8a86debab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","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 matrix-planner 0.2.1
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.