Skip to main content

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:

  • amd64
  • arm64

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


Download files

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

Source Distribution

py_connect_test-2.2.0.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

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

py_connect_test-2.2.0-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

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

Hashes for py_connect_test-2.2.0.tar.gz
Algorithm Hash digest
SHA256 bf3c70c1f786e12471ef057fe31a8045591bafb740d5cfc131b081794b05b8a4
MD5 3070e7cdafe190d7bf7b988deb59f3ca
BLAKE2b-256 0c7b6f63180ecc98598c7b8c0ee33d6a38a28076fc1bcba85ef9cf609393f61c

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file py_connect_test-2.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for py_connect_test-2.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ec8008833c65c7dd5199b1ae93d9527f78609dc87dee7535eb197f0333229c25
MD5 0dd63d50da8db80149565c1fe4ee19f4
BLAKE2b-256 7107c97453e77d1cf96e124bbb0f63b93375419f8aa4cca01aa2343493007e83

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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