FastAPI-Cronsv2.4.0

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.

bash
pip install fastapi-crons

Optional 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]".

ExtraInstallWhat it adds
sqlalchemypip install "fastapi-crons[sqlalchemy]"SQLAlchemy state and lock backends.
sqlmodelpip install "fastapi-crons[sqlmodel]"The same backends, plus SQLModel itself.
otelpip 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

bash
python -c "import fastapi_crons; print(fastapi_crons.__version__)"

You can also list the CLI commands:

bash
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

bash
pip install --upgrade fastapi-crons
Esc
IntroductionGetting StartedInstallationGetting StartedQuick StartGetting StartedCron ExpressionsCore ConceptsDefining JobsCore ConceptsHooksCore ConceptsConfigurationCore ConceptsState BackendsBackendsDistributed LockingBackendsDashboardOperationsHTTP EndpointsOperationsCLIOperations