Skip to content

tech1ndex/py-connect-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

89 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyPI version Python 3.14+

py-connect-test

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.

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 a URL specified in the PY_CONNECT_TEST_URL environment variable:

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 PY_CONNECT_TEST_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

Environment Variables

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

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

About

Simple Python DockerFile to test connectivity to URLs and Log Status Code

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors