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.

Metadata

Release files for fast-healthchecks 1.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fast-healthchecks 1.2.0
File Size Uploaded Provenance Actions
fast_healthchecks-1.2.0.tar.gz 126.3 kB With provenance Details for fast_healthchecks-1.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for fast-healthchecks 1.2.0
File Interpreter ABI Platform Actions
fast_healthchecks-1.2.0-py3-none-any.whl Python 3 none any Details for fast_healthchecks-1.2.0-py3-none-any.whl

Total release size: 182.9 kB

Release files / fast_healthchecks-1.2.0.tar.gz

Download URL fast_healthchecks-1.2.0.tar.gz
Size 126.3 kB
Tags Source
SHA-256 checksum
How to use checksums
de0b963c3622cf1777ea1d5958ee122f4ad3be1a688044aeea2a004c6984206c
BLAKE2b-256 checksum
How to use checksums
82fee46d416e409e5dc5e02f901bcfa99306f51ef9a9b2e7c093e65ade02f047
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 26, 2026.

Transparency log

Release files / fast_healthchecks-1.2.0-py3-none-any.whl

Download URL fast_healthchecks-1.2.0-py3-none-any.whl
Size 56.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
80d0c3ad63cdd99ce2e62de32b4ae5d5efe882599daadab30a9812f568acb2ae
BLAKE2b-256 checksum
How to use checksums
d8a7ce69a2481bef3defccd211935e8c5e2a31b47ea525b013598c384cf1bda9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 26, 2026.

Transparency log

Security for fast-healthchecks 1.2.0

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for fast_healthchecks-1.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 26, 2026.

Transparency log

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.

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