Skip to main content

Heath check on FastAPI applications.

Project description

FastAPI Health 🚑️

Latest Commit
Package version

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.0.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

fastapi_health-0.3.0-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

Details for the file fastapi-health-0.3.0.tar.gz.

File metadata

  • Download URL: fastapi-health-0.3.0.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

Hashes for fastapi-health-0.3.0.tar.gz
Algorithm Hash digest
SHA256 22a242a6db4e9d241e16f84d4f1e51d0fc663149c82d86fa34a03ce4aeae8f3e
MD5 287ccac8a53c626305a19c840044d6ac
BLAKE2b-256 81605376f2d5c64321af5623a04b02ef8e333e7eb3878c2d5d5b5532def75d95

See more details on using hashes here.

File details

Details for the file fastapi_health-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: fastapi_health-0.3.0-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

Hashes for fastapi_health-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 315d9b078c47e6f118380d71f63eadeb412afa82c038d002d17fbb9cc6278a31
MD5 2653c9ae33b1898309e823bdc65a8220
BLAKE2b-256 57de33f5cae4a0a7b80da6fabcb15de543a7e627b6bbf1a85ea6db5335722ff8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page