Heath check on FastAPI applications.
Project description
FastAPI Health 🚑️
The goal of this package is to help you to implement the Health Check API pattern.
Installation
pip install fastapi-health
Usage
Using this package, you can create the health check endpoint dynamically using different conditions. Each condition is a callable and you can even have dependencies inside of it.
from fastapi import FastAPI, Depends
from fastapi_health import health
def get_session():
return True
def is_database_online(session: bool = Depends(get_session)):
return session
app = FastAPI()
app.add_api_route("/health", health([is_database_online]))
The /health
endpoint on the example can return two possible response status code:
- 200 (Ok): conditions are satisfied.
- 503 (Service Unavailable): at least one condition is false.
License
This project is licensed under the terms of the MIT license.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
fastapi-health-0.3.1.tar.gz
(3.3 kB
view details)
Built Distribution
File details
Details for the file fastapi-health-0.3.1.tar.gz
.
File metadata
- Download URL: fastapi-health-0.3.1.tar.gz
- Upload date:
- Size: 3.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.7 CPython/3.8.11 Linux/5.8.0-63-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a2848daeed87a273a8d632a3c174307bd726265ca7e1f97e450ef67709b0dfb8 |
|
MD5 | dcb0435017467ae60c1732ece7b9fd03 |
|
BLAKE2b-256 | 341c6577f1dff6f16af9c90144f0c365221994a24551092d5cf4fbba3cd92d09 |
File details
Details for the file fastapi_health-0.3.1-py3-none-any.whl
.
File metadata
- Download URL: fastapi_health-0.3.1-py3-none-any.whl
- Upload date:
- Size: 3.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.7 CPython/3.8.11 Linux/5.8.0-63-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9cb1fca99503863047415e6dc5f4ab670594caf44829793bef7001a2047b00e3 |
|
MD5 | 51944c1b5e772e9a87ef5974f706502e |
|
BLAKE2b-256 | 43b76eec2b660b4033e3d8c46b95edfa89b5e1072925e8f4496ccdeb8efc39d6 |