A simple Python package to test basic HTTP connectivity to URLs. Built with Typer CLI framework and httpx. Can be used for monitoring, debugging, or as a health check tool in various environments such as ntfy, healchecks.io, or custom monitoring solutions.
- Python 3.14 or higher
- Poetry (for dependency management)
pip install py-connect-test...
git clone https://github.com/tech1ndex/py-connect-test.git
cd py-connect-test
poetry installTest connectivity to a URL specified in the PY_CONNECT_TEST_URL environment variable:
py-connect-test testpy-connect-test test --insecure
# or
py-connect-test test -ipy-connect-test test --alerts
# or
py-connect-test test -apy-connect-test test --insecure --alertspy-connect-test test --helpdocker build -t py-connect-test:latest .docker run -d \
-e PY_CONNECT_TEST_URL=https://example.com \
-e WEBHOOK_URL=http://prometheus.local \
ghcr.io/tech1ndex/py-connect-test:latestdocker run -d \
-e PY_CONNECT_TEST_URL=https://example.com \
ghcr.io/tech1ndex/py-connect-test:latest \
py-connect-test test --insecureAvailable architectures:
amd64arm64
Pull specific architecture:
docker pull ghcr.io/tech1ndex/py-connect-test:latest| Variable | Description | Default | Required |
|---|---|---|---|
PY_CONNECT_TEST_URL |
URL to test connectivity to | https://ntfy.me |
Yes |
WEBHOOK_URL |
Webhook URL for alerts | http://prometheus.local |
No |
PAYLOAD_FILE_PATH |
Path to JSON payload file for webhooks | /app/src/py_connect_test/templates/alertmanager-payload.json |
No |
py-connect-test/
├── src/py_connect_test/
│ ├── main.py # CLI entry point
│ ├── settings.py # Configuration management
│ ├── setup_logger.py # Logger setup
│ ├── py.typed # Type hints marker
│ └── services/
│ └── http.py # HTTP service
├── tests/
│ ├── conftest.py # Pytest fixtures
│ └── services/
│ └── test_http_service.py # HTTP service tests
├── pyproject.toml # Project configuration
├── Dockerfile # Docker configuration
└── README.md