healthyurl
A simple command-line tool to perform health checks on a given URL using Python's standard library. Exits with code 1 on HTTP errors.
Installation
For a minimal installation in Docker:
ADD --chmod=755 https://raw.githubusercontent.com/mgaitan/healthyurl/main/healthyurl.py /usr/bin/healthyurl
Altenatively you can use uv:
uv tool install healthyurl
Or pip
pip install --user healthyurl
Usage
healthyurl <url>
Checks the URL and exits with 1 on any HTTP errors. Or in quiet mode:
healthyurl -q <url>
Why use healthyurl?
When using slim images like Python-based microservices, installing curl adds around 5Mb (4.3% of python:3.12-slim-bookworm size). healthyurl uses only Python's standard library and does not require installing additional packages, making it more efficient for containers that need to stay small and lightweight.
For example, to use healthyurl as part of a health check in a Docker Compose file, you can define it like this:
services:
myservice:
image: myservice:latest
healthcheck:
test: ["CMD", "healthyurl", "http://localhost:8080/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
This configuration runs healthyurl every 30 seconds, and it checks the health of the service at http://localhost:8080/health. If the health check fails (returns an HTTP error), the service will be marked as unhealthy.
In the same way, To use healthyurl in an ECS task definition, you can configure the health check like this:
{
"containerDefinitions": [
{
"name": "myservice",
"image": "myservice:latest",
"healthCheck": {
"command": [
"CMD-SHELL",
"healthyurl -q http://localhost:8080/health"
],
"interval": 30,
"timeout": 10,
"retries": 3,
"startPeriod": 10
}
}
]
}
Both examples show how healthyurl can replace curl, wget etc for basic health checks, helping reduce image size and build times, especially for lightweight Python-based containerized applications.
Metadata
Release files for healthyurl 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| healthyurl-0.1.1.tar.gz | 2.2 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| healthyurl-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 5.0 kB
Release files / healthyurl-0.1.1.tar.gz
| Download URL | healthyurl-0.1.1.tar.gz |
|---|---|
| Size | 2.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a1a693c1c9bc77aa57cd0c48605de3171590cc79ad27fc8053704c5ae7878608
|
|
BLAKE2b-256 checksum How to use checksums |
a24443a475942c5ff271e8f3b2dd66790e0acd40b99fd3b0b35d637f9eba6d7e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.1.1 CPython/3.12.6
|
Release files / healthyurl-0.1.1-py3-none-any.whl
| Download URL | healthyurl-0.1.1-py3-none-any.whl |
|---|---|
| Size | 2.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
008c34e4cc685843a3ca7d42f614d0b2f712d29b0fa1a8be5fca3d0b15d149b7
|
|
BLAKE2b-256 checksum How to use checksums |
a1df0db0259ca90fdd6e630bb5c99020992b1e81137264fbdcd873306e7cc478
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.1.1 CPython/3.12.6
|
Security for healthyurl 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.