pingping is a special library which understands multi linguistic of ping output and translated the result to machine understandable format. Pingping support tcp-ping
Project description
Multi Linguistic Ping (pingping)
Table of Contents
- Introduction
- Docs
- Commands
- Pre-requisites
- Installation and Downloads
- FAQ
- Other Resources
- Bug Tracker and Support
- Unit Tests
- Development
- Contributing
- Changelog
- License and Copyright
- Author and Thanks
Introduction
pingping is a special library which understands multi linguistic of ping output and translated the result to machine understandable format. i.e. Json
pingping is a vendor independent library where you can parse any language ping output
pingping support tcping which works on transport layer i.e. Ping on proxy server, here ping refers to seding packets via tcp protocol to check the connectivity.
Docs
How to use pingping?
-
Command Line
Typepingping <ip-address>orpingping <ip-address> --web. For more help typepingping -h -
Python
It's very simple, create an object of Ping and call ping method with ip address. Internally it calls system ping command and captures the needed result.
How to run ping command?
# cli
pingping 192.168.1.1
pingping 1.1.1.1
# python code
obj = Ping()
print(obj.ping('192.168.1.1'))
print(obj.ping('1.1.1.1'))
# python tcping ping
obj = Ping(command='tcping', layer=4, timeout=3)
print(obj.ping('192.168.1.1'))
print(obj.ping('1.1.1.1'))
It returns Json output and easy to understand by the keys of it.
{"ip": "192.168.1.1", "loss_percentage": 100.0}
{"ip": "1.1.1.1", "loss_percentage": 0.0, "min": 55.669, "avg": 78.198, "max": 130.778, "time_in": "ms"}
How to capture result from ping output?
I am having ping result how to analise the output of it.
Ping.fetch_ping_data(ping_output) # it's a class method.
It automatically identifies the ip address and important details from it. It doesn't have any language barier.
{"ip": "1.1.1.1", "loss_percentage": 0.0, "min": 55.669, "avg": 78.198, "max": 130.778, "time_in": "ms"}
Commands
Usage pingping <ip-address>
-c | --count <Number>
-l4 | --web | --tcp | --http (ping over proxy)
-h | --help
Pre-requisites
pingping supports Python 3.9+. The OS should not matter.
- shconfparser is used to capture the data.
Installation and Downloads
The best way to get pingping is with pip or uv:
pip install pingping
Or using uv:
uv pip install pingping
If you're interested in the source, you can always pull from the github repo:
git clone https://github.com/network-tools/pingping.git
cd pingping
uv sync --all-extras # Install with dev dependencies
FAQ
- Question: What Python versions does pingping support?
Answer: pingping requires Python 3.8 or higher. All releases are tested against Python 3.8, 3.9, 3.10, 3.11, and 3.12.
Other Resources
- Python3 documentation is a good way to learn python
- Python GeeksforGeeks
- JSON
Bug Tracker and Support
- Please report any suggestions, bug reports, or annoyances with pingping through the Github bug tracker. If you're having problems with general python issues, consider searching for a solution on Stack Overflow.
- If you can't find a solution for your problem or need more help, you can ask a question.
- You can also ask on the Stack Exchange Network Engineering site.
Unit Tests
-
pingping project unit tests are running at GitHub Actions via pytest for Python 3.9+.
-
The current build status is:
Development
This project uses modern Python tooling:
- uv - Fast Python package installer and resolver
- ruff - Fast Python linter
- black - Code formatter
- pytest - Testing framework
- testiq - Test quality analysis tool
Quick Start
# Install uv if you haven't already
curl -LsSf https://astral.sh/uv/install.sh | sh
# Clone and set up the project
git clone https://github.com/network-tools/pingping.git
cd pingping
# Install dependencies
make install
# Run tests
make test
# Run all quality checks (linter, formatter, tests)
make all
Makefile Commands
The project includes a Makefile for common development tasks:
make help # Show all available commands
# Run testiq analysis (using Makefile)
make testiq
# Get test quality score
make testiq-score
# Generate HTML report
make testiq-html
open testiq_report.html
Or use commands directly:
# Generate coverage data for TestIQ
uv run pytest --testiq-output=testiq_coverage.json
# Analyze for duplicate tests (skip similarity with threshold 1.0)
uv run testiq analyze testiq_coverage.json --threshold 1.0
# Get test quality score
uv run testiq quality-score testiq_coverage.jsonn all CI checks locally
Test Quality Analysis
Analyze test quality and find duplicates using TestIQ:
# Generate coverage data for TestIQ
uv run pytest --testiq-output=testiq_coverage.json
# Analyze for duplicate tests (skip similarity with threshold 1.0)
uv run testiq analyze testiq_coverage.json --threshold 1.0
# Get test quality score
uv run testiq quality-score testiq_coverage.json
# Generate HTML report with test duplicates analysis
uv run testiq analyze testiq_coverage.json --threshold 1.0 --format html --output testiq_report.html
open testiq_report.html
Contributing
We welcome contributions! Please see our Contributing Guide for detailed information on:
- Setting up your development environment
- Running tests and quality checks
- Code style guidelines
- Submitting pull requests
Changelog
See CHANGELOG.md for a detailed history of changes to this project.
License and Copyright
-
pingping is licensed MIT 2019
Author and Thanks
pingping was developed by Kiran Kumar Kotari
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pingping-1.3.5.tar.gz.
File metadata
- Download URL: pingping-1.3.5.tar.gz
- Upload date:
- Size: 14.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ec9c9c9f33aacbc90f4bbb9eba29b67723b1d6f46e5e48750344eef6a3c2d657
|
|
| MD5 |
3eb6e4216199c88511181176c9e9a640
|
|
| BLAKE2b-256 |
d83dc9fb95b486cb953b13d600e14bebdceaae355d39955ffe016d2a1e1903fd
|
Provenance
The following attestation bundles were made for pingping-1.3.5.tar.gz:
Publisher:
release.yml on network-tools/pingping
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pingping-1.3.5.tar.gz -
Subject digest:
ec9c9c9f33aacbc90f4bbb9eba29b67723b1d6f46e5e48750344eef6a3c2d657 - Sigstore transparency entry: 833025929
- Sigstore integration time:
-
Permalink:
network-tools/pingping@31caeceeee9e44903d715873b7e8641a1efc54b7 -
Branch / Tag:
refs/tags/v1.3.5 - Owner: https://github.com/network-tools
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@31caeceeee9e44903d715873b7e8641a1efc54b7 -
Trigger Event:
release
-
Statement type:
File details
Details for the file pingping-1.3.5-py3-none-any.whl.
File metadata
- Download URL: pingping-1.3.5-py3-none-any.whl
- Upload date:
- Size: 7.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1ae94ff8ade232ce612e7fa4168bb0b1c7e734e49ed7d265a59c544ba9c67294
|
|
| MD5 |
886666ad22219379fbe4d5fa8592c4b6
|
|
| BLAKE2b-256 |
3865a3693889a3fcd49787f68b4cf63db92b95b5f1a0cbcbf9a77e3c0a08031f
|
Provenance
The following attestation bundles were made for pingping-1.3.5-py3-none-any.whl:
Publisher:
release.yml on network-tools/pingping
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pingping-1.3.5-py3-none-any.whl -
Subject digest:
1ae94ff8ade232ce612e7fa4168bb0b1c7e734e49ed7d265a59c544ba9c67294 - Sigstore transparency entry: 833025978
- Sigstore integration time:
-
Permalink:
network-tools/pingping@31caeceeee9e44903d715873b7e8641a1efc54b7 -
Branch / Tag:
refs/tags/v1.3.5 - Owner: https://github.com/network-tools
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@31caeceeee9e44903d715873b7e8641a1efc54b7 -
Trigger Event:
release
-
Statement type: