Skip to main content

Ping diagnostics and network optimization suggestions for Python and the command line.

This project has been quarantined.

PyPI Admins need to review this project before it can be restored. While in quarantine, the project is not installable by clients, and cannot be being modified by its maintainers.

Read more in the project in quarantine help article.

Project description

NetPing

NetPing is a Python package and CLI for advanced ping diagnostics, website reachability analysis, and practical network optimization suggestions.

It focuses on four things:

  • Measuring latency, jitter, and packet loss with the system ping tool
  • Timing DNS resolution and collecting address metadata
  • Checking TCP reachability for application-facing ports such as 443
  • Generating actionable recommendations and a weighted network health score

Features

  • Cross-platform ping execution through the operating system ping utility
  • Summary statistics for latency, jitter, packet loss, percentile tail latency, deviation, and stability
  • DNS lookup timing, forward resolution, and reverse DNS lookups
  • TCP connectivity timing for arbitrary ports
  • Optional path MTU probing where the local platform supports "do not fragment" pings
  • Parallel website batch diagnostics with profile-based target groups
  • Config-backed CLI defaults via netping init
  • Text and JSON CLI output
  • Reusable Python API

Installation

pip install NetPing

For local development:

python -m pip install -e .[dev]

Quick Start

Run a simple diagnostic:

netping diagnose 1.1.1.1

Run more samples and print JSON:

netping diagnose example.com --count 8 --tcp-port 443 --tcp-port 8443 --json

Run a batch check against common websites:

netping websites --profile general --workers 4

Run a custom list of sites:

netping websites --target github.com --target python.org --sort-by latency --json

Probe the path MTU in addition to standard diagnostics:

netping diagnose 8.8.8.8 --probe-mtu

Initialize the local config after installation:

netping init

List built-in profiles and inspect the active config:

netping profiles
netping config

Use it from Python:

from netping import diagnose_target

report = diagnose_target(
    "1.1.1.1",
    count=5,
    timeout_ms=1000,
    probe_mtu=True,
    tcp_ports=[443, 853],
)
print(report.network_score, report.health_label)
print(report.summary.average_latency_ms, report.summary.percentile_95_latency_ms)
for recommendation in report.recommendations:
    print("-", recommendation.title)

Batch diagnostics from Python:

from netping import diagnose_websites

batch = diagnose_websites(profile="developer", count=3, tcp_ports=[443], workers=4)
print(batch.aggregate.best_target, batch.aggregate.average_score)
for item in batch.results:
    print(item.rank, item.name, item.report.network_score)

Example Output

Target: 1.1.1.1
Score: 91/100 (excellent)
Quality grade: excellent
Samples: 5
Packet loss: 0.00% (success 100.00%)
Latency min/avg/max: 11.20 / 13.08 / 17.80 ms
Latency median/p95/stddev: 12.90 / 17.10 / 2.24 ms
Latency spread: 6.60 ms | Stability score: 93/100
Jitter: 2.14 ms
DNS lookup: 6.84 ms
Resolved addresses: 1.1.1.1
TCP checks:
- Port 443: reachable in 17.20 ms

Recommendations
- [info] Overall network health is excellent: Computed network score: 91/100 with ping quality graded as excellent.
- [info] TCP connectivity checks succeeded: The requested TCP services accepted connections.

Publishing

Build the distribution files:

python -m pip install build
python -m build

Upload them:

python -m pip install twine
python -m twine upload dist/*

If the package name is already taken on PyPI, update the name field in pyproject.toml before publishing.

You should also add your own repository URL and author metadata before publishing a public release.

NetPing does not execute arbitrary commands during pip install. Use netping init for explicit first-run setup instead.

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

netping-0.2.0.tar.gz (15.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

netping-0.2.0-py3-none-any.whl (17.6 kB view details)

Uploaded Python 3

File details

Details for the file netping-0.2.0.tar.gz.

File metadata

  • Download URL: netping-0.2.0.tar.gz
  • Upload date:
  • Size: 15.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.5

File hashes

Hashes for netping-0.2.0.tar.gz
Algorithm Hash digest
SHA256 8659c7fee693d65fde45e567c0aeb951b5af7697d12f6490397d59eda4c9e993
MD5 34d750e45511a9e95c92f11273e7f4da
BLAKE2b-256 abacf9983d53ee7560a05ae314c8d9a3b945d0a3ae423a7da92f2fb37562600a

See more details on using hashes here.

File details

Details for the file netping-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: netping-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 17.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.5

File hashes

Hashes for netping-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a2de9c68ec36b3ef1e3bcadf1a5742b8a72e091e0a4147ac4851910d1175f2d0
MD5 b23bd60ea7acb8b464ede94a3013077d
BLAKE2b-256 f092ed8623a24a75a0dd09467bedea95e4ac013e519e30b97b113535b9d4bd23

See more details on using hashes here.

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