A simple Python package for testing connectivity.
Project description
py-connect-test
A simple Python package to test HTTP connectivity to URLs and retrieve status codes. Built with Typer CLI framework and httpx.
Prerequisites
- Python 3.14 or higher
- Poetry (for dependency management)
Installation
From Source
git clone https://github.com/tech1ndex/py-connect-test.git
cd py-connect-test
poetry install
Usage
Basic Usage
Test connectivity to the default URL (https://ifconfig.me):
poetry run py-connect-test test
Or directly:
python -m py_connect_test.main test
Options
Bypass SSL Certificate Validation
poetry run py-connect-test test --insecure
# or
poetry run py-connect-test test -i
Send Alerts to Webhook
poetry run py-connect-test test --alerts
# or
poetry run py-connect-test test -a
Combined Options
poetry run py-connect-test test --insecure --alerts
View Help
poetry run py-connect-test test --help
Docker Usage
Build Image
docker build -t py-connect-test:latest .
Run Container
docker run -d \
-e HTTP_URL=https://example.com \
-e WEBHOOK_URL=http://prometheus.local \
ghcr.io/tech1ndex/py-connect-test:latest
Bypass SSL Validation
docker run -d \
-e PY_CONNECT_TEST_URL=https://example.com \
ghcr.io/tech1ndex/py-connect-test:latest \
py-connect-test test --insecure
Multi-Architecture Support
Available architectures:
amd64arm64
Pull specific architecture:
docker pull ghcr.io/tech1ndex/py-connect-test:latest-amd64
docker pull ghcr.io/tech1ndex/py-connect-test:latest-arm64
Environment Variables
| Variable | Description | Default | Required |
|---|---|---|---|
PY_CONNECT_TEST_URL |
URL to test connectivity to | https://ifconfig.me |
No |
WEBHOOK_URL |
Webhook URL for alerts | http://prometheus.local |
No |
PAYLOAD_FILE_PATH |
Path to JSON payload file for webhooks | /tmp/payload.json |
No |
Project Structure
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file py_connect_test-2.2.0.tar.gz.
File metadata
- Download URL: py_connect_test-2.2.0.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bf3c70c1f786e12471ef057fe31a8045591bafb740d5cfc131b081794b05b8a4
|
|
| MD5 |
3070e7cdafe190d7bf7b988deb59f3ca
|
|
| BLAKE2b-256 |
0c7b6f63180ecc98598c7b8c0ee33d6a38a28076fc1bcba85ef9cf609393f61c
|
Provenance
The following attestation bundles were made for py_connect_test-2.2.0.tar.gz:
Publisher:
pypi-publish.yml on tech1ndex/py-connect-test
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
py_connect_test-2.2.0.tar.gz -
Subject digest:
bf3c70c1f786e12471ef057fe31a8045591bafb740d5cfc131b081794b05b8a4 - Sigstore transparency entry: 1591844226
- Sigstore integration time:
-
Permalink:
tech1ndex/py-connect-test@fd040b5a184bd0c4290b2fb08cc7671fb442e478 -
Branch / Tag:
refs/tags/v2.2.0 - Owner: https://github.com/tech1ndex
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@fd040b5a184bd0c4290b2fb08cc7671fb442e478 -
Trigger Event:
release
-
Statement type:
File details
Details for the file py_connect_test-2.2.0-py3-none-any.whl.
File metadata
- Download URL: py_connect_test-2.2.0-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ec8008833c65c7dd5199b1ae93d9527f78609dc87dee7535eb197f0333229c25
|
|
| MD5 |
0dd63d50da8db80149565c1fe4ee19f4
|
|
| BLAKE2b-256 |
7107c97453e77d1cf96e124bbb0f63b93375419f8aa4cca01aa2343493007e83
|
Provenance
The following attestation bundles were made for py_connect_test-2.2.0-py3-none-any.whl:
Publisher:
pypi-publish.yml on tech1ndex/py-connect-test
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
py_connect_test-2.2.0-py3-none-any.whl -
Subject digest:
ec8008833c65c7dd5199b1ae93d9527f78609dc87dee7535eb197f0333229c25 - Sigstore transparency entry: 1591844245
- Sigstore integration time:
-
Permalink:
tech1ndex/py-connect-test@fd040b5a184bd0c4290b2fb08cc7671fb442e478 -
Branch / Tag:
refs/tags/v2.2.0 - Owner: https://github.com/tech1ndex
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@fd040b5a184bd0c4290b2fb08cc7671fb442e478 -
Trigger Event:
release
-
Statement type: