The runtime layer for Python control-plane services: config, logging, metrics, health, secrets and a service CLI.
Actively maintained. Last release today, commits in 21 of the last 26 weeks. A safe choice.
pip install scaloREADME as published on PyPI with version 2.32.16.
scalo
The runtime layer for Python control-plane services: config, logging, metrics, health, secrets and a service CLI. It comes wired together: subclass one class and your service reads its config, logs in the right format for where it runs, and serves its health probes.
It is built for APIs, orchestrators, CLI tools and integration glue. For the hot path there is a Rust sister library, scalo-rs, with the same conventions and a different API.
What it gives you
- A seven-layer config cascade, from CLI flags and env vars down to YAML and defaults, that reads the same in a laptop shell and a Kubernetes pod.
- Structured logs, JSON in a container and readable text at a terminal. Credentials, tokens and keys are masked, and so are cards, IBANs, emails and phone numbers, and Australian ABN, ACN, TFN and Medicare numbers where a keyword names them. TRACE records skip the scrubber by default.
ServiceApp: subclass it and getrun,version,config-checkandgenerate-artefacts, with config and logging started for you, and metrics as well oncescalo[metrics]is installed./livezand/readyzon an observability port kept apart from your application's port.- With the
metricsextra, Prometheus and OpenTelemetry metrics, process and container gauges included, scraped from/metricson the same port. Without a metrics manager that path answers 404. - Secrets from OpenBao or Vault, AWS, GCP, Azure, and Kubernetes, one extra per backend.
- A deployment contract: return one from
deployment_contract()andgenerate-artefactswrites your runtime Dockerfile and the contract the scalo-service Helm chart renders from. - Kafka, CEL expressions and an HTTP client with jittered retry, each behind a separate extra.
Example
uv add scalo
from scalo.cli import ServiceApp, VersionInfo
from scalo.logger import logger
class Greeter(ServiceApp):
name = "greeter"
env_prefix = "GREETER"
def version_info(self) -> VersionInfo:
return VersionInfo(self.name, "1.0.0")
def run_service(self, config) -> None:
logger.info("hello", target=config.get("target", "world"))
if __name__ == "__main__":
Greeter().cli()