schedr
A job scheduler written in Rust that runs Python DAGs, Python scripts and shell commands: a
native Python API for DAGs, one binary for the scheduler, its web UI and its workers, SQLite on
a laptop and Postgres in production.
Documentation: https://ptutak.github.io/schedr/ ·
Source: https://github.com/ptutak/schedr
Install
Python 3.14 or newer, in a virtual environment of a project directory:
mkdir my-schedr && cd my-schedr
python3.14 -m venv .venv
.venv/bin/pip install schedr # add [pydantic] for Pydantic models
The wheel carries the schedr binary (Linux x86_64 and aarch64, macOS arm64): nothing to
compile.
Run it
Put a DAG in dags/sync.py:
from datetime import timedelta
from schedr import CommandOperator, Cron, Dag, StepDefaults, dag_ctx, task
with Dag(
"sync_customers",
description="Syncs customers daily at 03:00 Warsaw time: extract, load, notify.",
trigger=Cron("0 3 * * *", tz="Europe/Warsaw", start="2026-01-01"),
defaults=StepDefaults(retries=2, retry_delay=timedelta(minutes=5)),
):
@task
def extract() -> list[dict[str, str]]:
return [{"id": "1", "name": "Ada"}, {"id": "2", "name": "Grace"}]
@task(timeout=timedelta(minutes=10))
def load(rows: list[dict[str, str]]) -> int:
print(f"loading {len(rows)} customers")
return len(rows)
rows = extract() # Output[list[dict[str, str]]]
count = load(rows) # load depends on extract (data flow)
CommandOperator( # depends on load: its command uses `count`
"notify",
command=["echo", t"synced {count} customers for {dag_ctx.run.planned_for}"],
)
Start schedr (the scheduler, the web UI and one worker, in one process, on SQLite), watching
the dags folder:
.venv/bin/schedr standalone --migrate --dag-path dags
The web UI is at http://127.0.0.1:8080/. In a second terminal:
.venv/bin/schedr dags list # sync_customers, paused
.venv/bin/schedr runs trigger sync_customers # a manual run
.venv/bin/schedr runs list sync_customers
.venv/bin/schedr dags unpause sync_customers # daily at 03:00 from now on
Ctrl-C stops it; the next start keeps the DAGs, runs and logs
(~/.local/share/schedr).
Next
- Getting started: these steps, explained
- Writing DAGs: tasks, data flow,
schedules, retries;
schedr dags check and schedr dags test without a server
- How schedr works: the life of a run,
the master and workers, failures, the web UI and its Metrics page
- Deployment: the images and
the Helm chart, Postgres, separate roles, a standby master
- Changelog