Skip to main content

A simple Python package for testing connectivity.

Project description

PyPI version Python 3.14+

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 PyPI

pip install py-connect-test

...

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):

py-connect-test test

Options

Bypass SSL Certificate Validation

py-connect-test test --insecure
# or
py-connect-test test -i

Send Alerts to Webhook

py-connect-test test --alerts
# or
py-connect-test test -a

Combined Options

py-connect-test test --insecure --alerts

View Help

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.1.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.1-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file py_connect_test-2.2.1.tar.gz.

File metadata

  • Download URL: py_connect_test-2.2.1.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.1.tar.gz
Algorithm Hash digest
SHA256 ae28664b5632f302321ce87152496a73dcf2e11ab258d22f90147963b92c1a3e
MD5 a30dc7360508a18384ffc72b77b3dbec
BLAKE2b-256 31b26968aca8741e2a566a5cc915be0bf0d73144f7e4fd58c080a4335091768d

See more details on using hashes here.

Provenance

The following attestation bundles were made for py_connect_test-2.2.1.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.1-py3-none-any.whl.

File metadata

File hashes

Hashes for py_connect_test-2.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2ebd7c997710e511612598bed08d8562ae2731623c769e5960e0b81a1e3f70ba
MD5 f8ca2052124986b55453c3e0fc329b27
BLAKE2b-256 13ec07f24cc5a0991f9d55802e8fe96bc9ed2dbe427b685d2288b5c7b7d46353

See more details on using hashes here.

Provenance

The following attestation bundles were made for py_connect_test-2.2.1-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