tcpp


Nametcpp JSON
Version 1.0.1 PyPI version JSON
download
home_pageNone
SummaryA Python implementation of TCP ping that tests connectivity to a remote host
upload_time2025-01-23 09:52:09
maintainerNone
docs_urlNone
authorNone
requires_python>=3.7
licenseNone
keywords tcp ping network connectivity diagnostic
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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:

```bash
pip install tcpp
```

## Usage

### Command Line

Basic usage:
```bash
tcpp bing.com
```

With custom port and count:
```bash
tcpp bing.com 443 -c 10
```

All available options:
```bash
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:

```python
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](LICENSE) file for details.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "tcpp",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": "tcp, ping, network, connectivity, diagnostic",
    "author": null,
    "author_email": "NanoApe <nanoapezlk@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/4c/8e/7a6f9c6e0311177bf68521ac2f0728bba8767e36225c4100cc49e4bd3d01/tcpp-1.0.1.tar.gz",
    "platform": null,
    "description": "# tcpp\n\nA 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.\n\n## Features\n\n- \ud83d\ude80 Pure Python implementation, no external dependencies\n- \ud83d\udce6 Lightweight and easy to use\n- \ud83c\udf10 Supports both IPv4 and IPv6\n- \ud83d\udd04 Supports continuous ping mode\n\n## Installation\n\nYou can install `tcpp` directly from PyPI:\n\n```bash\npip install tcpp\n```\n\n## Usage\n\n### Command Line\n\nBasic usage:\n```bash\ntcpp bing.com\n```\n\nWith custom port and count:\n```bash\ntcpp bing.com 443 -c 10\n```\n\nAll available options:\n```bash\ntcpp [-h] [-c COUNT] [-t TIMEOUT] [-4] [-6] [-v] host [port]\n\npositional arguments:\n  host                  Target hostname or IP address to ping\n  port                  Target port number (default: 80)\n\noptions:\n  -h, --help           Show this help message and exit\n  -c, --count COUNT    Number of pings to send (default: 10, 0 = infinite)\n  -t, --timeout SEC    Connection timeout in seconds (default: 1.0)\n  -4                   Force using IPv4\n  -6                   Force using IPv6\n  -v, --version        Show program version\n```\n\n### Python API\n\nYou can also use tcpp as a Python library:\n\n```python\nimport tcpp\n\n# Basic usage\nstats = tcpp.ping(\"bing.com\", port=80)\n\n# Access statistics\nprint(f\"Success rate: {stats.success_rate}%\")\nprint(f\"Average time: {stats.avg_time:.2f}ms\")\n```\n\n## bing Output\n\n```\nTCPING bing.com (13.107.21.200)[:80]\nConnected to bing.com[:80]: seq=1 time=61.64 ms\nConnected to bing.com[:80]: seq=2 time=61.39 ms\nConnected to bing.com[:80]: seq=3 time=59.84 ms\nConnected to bing.com[:80]: seq=4 time=59.29 ms\n\n--- bing.com[:80] tcping statistics ---\n4 connections, 4 successed, 0 failed, 100.00% success rate\nmin = 59.29ms, max = 61.64ms, avg = 60.54ms, med = 60.62ms, mdev = 1.00ms\n```\n\n## Requirements\n\n- Python 3.7 or higher\n- No external dependencies\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A Python implementation of TCP ping that tests connectivity to a remote host",
    "version": "1.0.1",
    "project_urls": {
        "Homepage": "https://github.com/Konano/tcpp",
        "Repository": "https://github.com/Konano/tcpp"
    },
    "split_keywords": [
        "tcp",
        " ping",
        " network",
        " connectivity",
        " diagnostic"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "70a8e4176e0c2ac85a028706c956d486b10a913f21d63361c3c479fdecca6625",
                "md5": "582fd156722b24f722a3f6491f01fe39",
                "sha256": "cae4ebdc13218c84f0247f0e90720c48944230889228523241634f726727226d"
            },
            "downloads": -1,
            "filename": "tcpp-1.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "582fd156722b24f722a3f6491f01fe39",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 6968,
            "upload_time": "2025-01-23T09:52:07",
            "upload_time_iso_8601": "2025-01-23T09:52:07.690145Z",
            "url": "https://files.pythonhosted.org/packages/70/a8/e4176e0c2ac85a028706c956d486b10a913f21d63361c3c479fdecca6625/tcpp-1.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "4c8e7a6f9c6e0311177bf68521ac2f0728bba8767e36225c4100cc49e4bd3d01",
                "md5": "a244807b2b12433de5b8677fad9dc8e5",
                "sha256": "856a66e64a1a79a0bf855ff6569513b9ca2fd6847b0f90439a24d94de96435ea"
            },
            "downloads": -1,
            "filename": "tcpp-1.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "a244807b2b12433de5b8677fad9dc8e5",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 8403,
            "upload_time": "2025-01-23T09:52:09",
            "upload_time_iso_8601": "2025-01-23T09:52:09.536471Z",
            "url": "https://files.pythonhosted.org/packages/4c/8e/7a6f9c6e0311177bf68521ac2f0728bba8767e36225c4100cc49e4bd3d01/tcpp-1.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-01-23 09:52:09",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Konano",
    "github_project": "tcpp",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "tcpp"
}
        
Elapsed time: 0.46169s