tcpp
A Python implementation of TCP ping that tests connectivity to a remote host by attempting TCP connections. It measures connection establishment times and provides detailed statistics.
Features
- 🚀 Pure Python implementation, no external dependencies
- 📦 Lightweight and easy to use
- 🌐 Supports both IPv4 and IPv6
- 🔄 Supports continuous ping mode
Installation
You can install tcpp directly from PyPI:
pip install tcpp
Usage
Command Line
Basic usage:
tcpp bing.com
With custom port and count:
tcpp bing.com 443 -c 10
All available options:
tcpp [-h] [-c COUNT] [-t TIMEOUT] [-4] [-6] [-v] host [port]
positional arguments:
host Target hostname or IP address to ping
port Target port number (default: 80)
options:
-h, --help Show this help message and exit
-c, --count COUNT Number of pings to send (default: 10, 0 = infinite)
-t, --timeout SEC Connection timeout in seconds (default: 1.0)
-4 Force using IPv4
-6 Force using IPv6
-v, --version Show program version
Python API
You can also use tcpp as a Python library:
import tcpp
# Basic usage
stats = tcpp.ping("bing.com", port=80)
# Access statistics
print(f"Success rate: {stats.success_rate}%")
print(f"Average time: {stats.avg_time:.2f}ms")
bing Output
TCPING bing.com (13.107.21.200)[:80]
Connected to bing.com[:80]: seq=1 time=61.64 ms
Connected to bing.com[:80]: seq=2 time=61.39 ms
Connected to bing.com[:80]: seq=3 time=59.84 ms
Connected to bing.com[:80]: seq=4 time=59.29 ms
--- bing.com[:80] tcping statistics ---
4 connections, 4 successed, 0 failed, 100.00% success rate
min = 59.29ms, max = 61.64ms, avg = 60.54ms, med = 60.62ms, mdev = 1.00ms
Requirements
- Python 3.7 or higher
- No external dependencies
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Metadata
Release files for tcpp 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| tcpp-1.0.1.tar.gz | 8.4 kB | Without provenance | Details for tcpp-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| tcpp-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for tcpp-1.0.1-py3-none-any.whl |
Total release size: 15.4 kB
Release files / tcpp-1.0.1.tar.gz
| Download URL | tcpp-1.0.1.tar.gz |
|---|---|
| Size | 8.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
856a66e64a1a79a0bf855ff6569513b9ca2fd6847b0f90439a24d94de96435ea
|
|
BLAKE2b-256 checksum How to use checksums |
4c8e7a6f9c6e0311177bf68521ac2f0728bba8767e36225c4100cc49e4bd3d01
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.32.3
|
Release files / tcpp-1.0.1-py3-none-any.whl
| Download URL | tcpp-1.0.1-py3-none-any.whl |
|---|---|
| Size | 7.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cae4ebdc13218c84f0247f0e90720c48944230889228523241634f726727226d
|
|
BLAKE2b-256 checksum How to use checksums |
70a8e4176e0c2ac85a028706c956d486b10a913f21d63361c3c479fdecca6625
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.32.3
|
Security for tcpp 1.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.