Getting Started
Installation
Install the base package, then add only the extras you actually use.
Requirements
Python 3.10 or newer, and FastAPI 0.100 or newer.
Base install
This is all you need to schedule jobs, persist state to SQLite, use the CLI and HTTP endpoints, and serve the web dashboard.
pip install fastapi-cronsuv add fastapi-cronspoetry add fastapi-cronsOptional extras
Anything that pulls in a heavy dependency is kept behind an extra, so a plain install stays small. Combine them with commas, for example pip install "fastapi-crons[dashboard,sqlmodel]".
| Extra | Install | What it adds |
|---|---|---|
sqlalchemy | pip install "fastapi-crons[sqlalchemy]" | SQLAlchemy state and lock backends. |
sqlmodel | pip install "fastapi-crons[sqlmodel]" | The same backends, plus SQLModel itself. |
otel | pip install "fastapi-crons[otel]" | OpenTelemetry tracing hooks. |
Quoting matters in zsh
zsh treats square brackets as a glob pattern. Quote the argument — pip install "fastapi-crons[sqlalchemy]" — or the install fails with no matches found.
What the base install pulls in
fastapi, croniter for expression parsing, aiosqlite for the default state backend, typer and rich for the CLI, plus pydantic, redis and aiohttp.
Verify the install
python -c "import fastapi_crons; print(fastapi_crons.__version__)"You can also list the CLI commands:
python -m fastapi_crons.cli --help__version__ can lag behind the release
The release automation bumps the version in pyproject.toml but not in fastapi_crons/__init__.py, so fastapi_crons.__version__ — and the version field of the health endpoint — can report an older number than the package you installed. pip show fastapi-crons is authoritative.
Upgrading
pip install --upgrade fastapi-crons