Fast Healthchecks
Project description
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
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.
- Configuration, shutdown, probe options: documentation.
- Public API and
to_dict(): API Reference. - PostgreSQL TLS certificate rotation: DSN formats.
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 withblock - 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).
- Changelog: CHANGELOG.md in the repo; Changelog in the online docs.
- Architecture decisions: Decisions (ADR) in the online docs.
- Security: See SECURITY.md for how to report vulnerabilities.
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=devonly, no extras). - Unit tests:
just tests-unit— runs pytest with-m unit. Expects dev deps and optional extras already installed (e.g. afteruv sync --group=dev --all-extrasor afterjust tests-integration). FastStream unit tests useTestKafkaBroker(connect_only=True)andTestAppso no real Kafka is required. - Integration tests:
just tests-integration— requires Docker anddocker compose; brings services up, runs integration tests, then brings them down. SetDOCKER_SERVICES_UP=1to 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 pre-commit, import tests, and unit tests on push/PR; integration tests run only on manual workflow dispatch or schedule.
Serve documentation
just serve-docs
Release and CI (maintainers)
Bump, rollback, workflows, secrets, pre-commit, 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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fast_healthchecks-1.0.0.tar.gz.
File metadata
- Download URL: fast_healthchecks-1.0.0.tar.gz
- Upload date:
- Size: 38.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
89717c0a9149d96cda858db017a306200edf2d947b04413b2adb634bee7abaa8
|
|
| MD5 |
16474f9ae9197d05f4ccd42c8626f4aa
|
|
| BLAKE2b-256 |
8f1a877d05331457b0a4088c24d4e50eba7107b344bf9c5601872596113320fc
|
Provenance
The following attestation bundles were made for fast_healthchecks-1.0.0.tar.gz:
Publisher:
3_release.yml on ZYLVEXT/fast-healthchecks
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fast_healthchecks-1.0.0.tar.gz -
Subject digest:
89717c0a9149d96cda858db017a306200edf2d947b04413b2adb634bee7abaa8 - Sigstore transparency entry: 1098283583
- Sigstore integration time:
-
Permalink:
ZYLVEXT/fast-healthchecks@e629a67c372441ca618219b5bbf91d71fe1ff7be -
Branch / Tag:
refs/heads/main - Owner: https://github.com/ZYLVEXT
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
3_release.yml@e629a67c372441ca618219b5bbf91d71fe1ff7be -
Trigger Event:
workflow_run
-
Statement type:
File details
Details for the file fast_healthchecks-1.0.0-py3-none-any.whl.
File metadata
- Download URL: fast_healthchecks-1.0.0-py3-none-any.whl
- Upload date:
- Size: 51.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6720ff27eec44340fbd4559e673865f261690b334be22eb201f3ad31177d56f4
|
|
| MD5 |
a3a6e58e6a595cafffe11cbb7246e2cc
|
|
| BLAKE2b-256 |
511658c665a08958435843626058cc9b4330df1628e04e25c56e7d813eb0e327
|
Provenance
The following attestation bundles were made for fast_healthchecks-1.0.0-py3-none-any.whl:
Publisher:
3_release.yml on ZYLVEXT/fast-healthchecks
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fast_healthchecks-1.0.0-py3-none-any.whl -
Subject digest:
6720ff27eec44340fbd4559e673865f261690b334be22eb201f3ad31177d56f4 - Sigstore transparency entry: 1098284073
- Sigstore integration time:
-
Permalink:
ZYLVEXT/fast-healthchecks@e629a67c372441ca618219b5bbf91d71fe1ff7be -
Branch / Tag:
refs/heads/main - Owner: https://github.com/ZYLVEXT
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
3_release.yml@e629a67c372441ca618219b5bbf91d71fe1ff7be -
Trigger Event:
workflow_run
-
Statement type: