Skip to main content

Python Actuator

Small, typed health checks for Python ASGI applications, inspired by the Spring Boot Actuator health API.

Installation

pip install python-actuator

Quick start

Create a health indicator for each component you want to monitor:

from python_actuator.indicators import HealthEndpoint
from python_actuator.models import HealthResult, HealthStatus


class DatabaseHealth:
    def health(self) -> HealthResult:
        return HealthResult(status=HealthStatus.UP)


health_endpoint = HealthEndpoint(
    indicators={"database": DatabaseHealth()},
)
app = health_endpoint.asgi_app()

The ASGI application exposes:

  • GET /actuator/health for the overall application status;
  • GET /actuator/health/{component} for one component;
  • GET /actuator/health/{component}/{instance} for a component instance;
  • HEAD requests for the same routes.

Healthy responses use HTTP 200. DOWN and OUT_OF_SERVICE responses use HTTP 503.

Health results

Health results can include additional details:

HealthResult(
    status=HealthStatus.UP,
    details={"message": "Database connection is ready"},
)

The response follows the Spring Boot Actuator shape:

{
  "status": "UP",
  "details": {
    "message": "Database connection is ready"
  }
}

Development

The project uses uv, pytest, Ruff, mypy, and ty:

make test
make check

License

MIT

Download files

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

Source Distribution

python_actuator-0.1.1.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

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

python_actuator-0.1.1-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file python_actuator-0.1.1.tar.gz.

File metadata

  • Download URL: python_actuator-0.1.1.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for python_actuator-0.1.1.tar.gz
Algorithm Hash digest
SHA256 4947aa2d8e30ade5c06ade9307bf049782bd1f5bedf50a7a8f19a9fcca1c0991
MD5 4d08d1a3bd89ecf2310a60dd782a10d4
BLAKE2b-256 d0bfd162bb5cdbd13cf1230a302f66baaa9a4dea61e4e7c86fc044e71279dfd2

See more details on using hashes here.

File details

Details for the file python_actuator-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: python_actuator-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 6.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for python_actuator-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 83db8c7ef822357be6976b92b72a5d39f3d207c2bb220be18e005d6f43cd88e1
MD5 b2aa1b7fa310e5e0aaf072c50bb40646
BLAKE2b-256 1eabea5bfd7ef55fea75450f98e646f9d19f5a97ef743b2ed4328b4b3c8d1265

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 files

0.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page