Skip to main content

Fast Healthchecks

Framework-agnostic health checks with integrations for the most popular ASGI frameworks: FastAPI / FastStream / Litestar to help you implement the Health Check API pattern


Test Passing Coverage Downloads Package version Supported Python versions License Documentation


Installation

pip install fast-healthchecks (or poetry add / uv add). Backends and framework integrations are optional extras. See documentation → Installation for all options and extra names.

Quick Start

FastAPI
from fastapi import FastAPI
from fast_healthchecks import Probe
from fast_healthchecks.integrations.fastapi import HealthcheckRouter

app = FastAPI()
app.include_router(HealthcheckRouter(Probe(checks=[...])))
FastStream / Litestar
from fast_healthchecks import Probe
from fast_healthchecks.integrations.faststream import health

# or: from fast_healthchecks.integrations.litestar import health
routes = health(Probe(checks=[...]))

Usage depends on the framework (FastAPI: HealthcheckRouter; FastStream / Litestar: health() from the corresponding integration). Full examples, configuration, lifecycle and shutdown, URL/SSRF, and DSN formats are in the documentation. Example projects: FastAPI, FastStream, Litestar.

Probe Runner (Advanced)

For fine-grained control over probe execution, use ProbeRunner as an async context manager:

from fast_healthchecks import Probe
from fast_healthchecks.execution import ProbeRunner, RunPolicy

probe = Probe(name="my-probe", checks=[...])

# Use context manager for automatic resource cleanup
async with ProbeRunner(
    policy=RunPolicy(
        mode="reporting",
        execution="sequential",
        probe_timeout_ms=5000,  # 5 second timeout per probe
    )
) as runner:
    report = await runner.run(probe)
    # Runner automatically closes probes on exit

Key features:

  • RunPolicy: Customize execution mode (strict/reporting), timeout, and health evaluation
  • Automatic cleanup: Probes are closed when exiting the async with block
  • Reusable runner: Run multiple probes with the same policy

See documentation for details.

Development

For the full list of recipes and their descriptions, run just or just --list (source of truth: justfile).

Setup environment

git clone https://github.com/ZYLVEXT/fast-healthchecks.git
cd fast-healthchecks
uv sync --group=dev --group=docs --all-extras

Run linters

just lint

Running tests

  • Import tests: just tests-imports — verifies ImportError messages when optional deps are missing; runs with minimal install (uv sync --group=dev only, no extras).
  • Unit tests: just tests-unit — runs pytest with -m unit. Expects dev deps and optional extras already installed (e.g. after uv sync --group=dev --all-extras or after just tests-integration). FastStream unit tests use TestKafkaBroker(connect_only=True) and TestApp so no real Kafka is required.
  • Integration tests: just tests-integration — requires Docker and docker compose; brings services up, runs integration tests, then brings them down. Copy .env.example to .env and override the service ports and matching DSNs there when the defaults are already in use. Set DOCKER_SERVICES_UP=1 to skip compose up/down when services are already running.
  • Full suite: just tests-all — runs import tests, then integration (compose up, pytest integration, compose down), then unit tests. Requires Docker.

Certificates in tests/certs/ are for tests only; see CONTRIBUTING § Test certificates.

CI runs prek and the complete import, integration, and unit test suite on pushes to main, pull requests, version tags, and manual workflow dispatches.

Serve documentation

just serve-docs

Release and CI (maintainers)

Bump, rollback, workflows, secrets, prek, and dependency updates: see CONTRIBUTING § CI and release and the workflows table there. Quick links: Bump version, Rollback release.

Known alternatives

License

This project is licensed under the terms of the MIT license.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fast_healthchecks-1.1.2.tar.gz (117.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fast_healthchecks-1.1.2-py3-none-any.whl (53.9 kB view details)

Uploaded Python 3

File details

Details for the file fast_healthchecks-1.1.2.tar.gz.

File metadata

  • Download URL: fast_healthchecks-1.1.2.tar.gz
  • Upload date:
  • Size: 117.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for fast_healthchecks-1.1.2.tar.gz
Algorithm Hash digest
SHA256 bb282a391b393bc3b32e66baa5c9bea2d0e1f1337267955392cd915704bb1b5f
MD5 b72b906217b4d32450ee42bb12141d0f
BLAKE2b-256 fe370260e3f1b1aa85a9aa8dac13b266f0a63e92ee3c6aff4048d0aff4353aba

See more details on using hashes here.

Provenance

The following attestation bundles were made for fast_healthchecks-1.1.2.tar.gz:

Publisher: 3_release.yml on ZYLVEXT/fast-healthchecks

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fast_healthchecks-1.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for fast_healthchecks-1.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e94efec2bfa1ecd4b6e2ea31ca99812bdfea23e35f94bae5cee9976f10081c31
MD5 81f23cf88fe787b824801e9ba5951901
BLAKE2b-256 d844397477b2d4c3b4fe66644fcbd76aeb30f4efaf5f09e0909d92f434f00274

See more details on using hashes here.

Provenance

The following attestation bundles were made for fast_healthchecks-1.1.2-py3-none-any.whl:

Publisher: 3_release.yml on ZYLVEXT/fast-healthchecks

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

1.2.0

2 files

This release

1.1.2 This release

2 files

1.1.1

2 files

1.1.0

2 files

1.0.0

2 files

0.2.4

2 files

0.2.3

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page