pythonping
A simple way to ping in Python
What it is and what it does
Pythonping is a Python library for sending ICMP echo requests (pings) to remote hosts, mimicking the behavior of the terminal ping command. It exposes a simple `ping()` function for basic use and modular classes (`Communicator`, `PayloadProvider`) for integration into larger applications. The library constructs raw IP packets and captures responses, returning a `ResponseList` object containing individual `Response` items with latency, packet size, and error information.
The package is designed for network diagnostics, host reachability testing, and latency measurement in Python scripts and applications. It supports customization via parameters like payload size, timeout, packet count, sweep ranges, and the Don't Fragment flag. Because ICMP requires raw socket access, the package mandates root or administrator privileges on all operating systems—a fundamental OS-level constraint, not a library limitation.
Use it for:
- Monitor host availability in a network management or alerting system by periodically pinging targets and collecting latency metrics.
- Perform network diagnostics in a troubleshooting script to verify connectivity and measure latency to remote servers.
- Implement a ping sweep to test a range of payload sizes and detect MTU or fragmentation issues on a network path.
- Integrate ICMP probing into a custom application that needs to detect network outages or measure end-to-end latency without spawning subprocesses.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Sends ICMP ping requests to remote hosts from Python, returning response metadata like latency and success status, with optional verbose terminal-style output.
Yes, if you need ICMP ping from Python and can run as root. The library is stable (Production/Stable classifier), has no dependencies, and carries no known vulnerabilities. However, maintenance is dormant (last release 2022-10-25); verify compatibility with your Python version before deploying. The root requirement is a hard constraint—unsuitable for unprivileged environments.
Install
pythonping on PyPI
pip
pip install pythonpinguv
uv add pythonpingpoetry
poetry add pythonpingInstalling pythonping
Before you install
Low install friction; pure Python wheel with no runtime dependencies. Maintenance is dormant—last release was 2022-10-25, over 1389 days ago, though the repository remains active with recent commits (2024-07-18). Suitable for stable use cases but do not expect rapid bug fixes or feature updates.
License in practice
MIT license (permissive) places no restrictions on use, modification, or distribution. Safe to incorporate into proprietary or open-source projects without licensing obligations.
Quickstart
from pythonping import ping
result = ping('127.0.0.1', verbose=True)
for response in result:
print(response)
Requires root or administrator privileges to create raw ICMP packets and access the network interface; cannot run as an unprivileged user.
Verify before relying
- Whether the package works reliably on modern Python versions (requires_python is unspecified in metadata).
- Current state of cross-platform support (Windows, macOS, Linux) given dormant maintenance status.
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | dormant — 1,389 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 492,442/month — #6,359 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pythonping-1.1.4-py3-none-any.whl
Keywords: ping, icmp, network
Tags
More Networking packages
h11 is a pure-Python HTTP/1.1 protocol…
permissive · top 100 on PyPI
psutilpsutil retrieves real-time information about…
permissive · top 1,000 on PyPI
pyOpenSSLpyOpenSSL wraps OpenSSL's SSL/TLS functionality…
permissive · top 1,000 on PyPI
uvloopuvloop is a drop-in replacement for Python's…
permissive · top 1,000 on PyPI
execnetexecnet lets you spawn and communicate with…
permissive · top 1,000 on PyPI
pyzmqPyZMQ provides Python bindings for ZeroMQ…
permissive · top 1,000 on PyPI
ping3Ping3 sends ICMP echo requests to hosts and…
permissive · top 15,000 on PyPI
icmplibicmplib provides a pure Python implementation…
copyleft · top 5,000 on PyPI
multipingMultiPing sends ICMP echo requests (pings) to…
permissive · top 15,000 on PyPI
pingparsingExecutes and parses ping command output,…
permissive · top 15,000 on PyPI
aiopingaioping provides an asyncio-based ICMP ping…
copyleft · top 15,000 on PyPI
speedtest-cliCommand-line tool that measures internet…
permissive · top 15,000 on PyPI
dpktdpkt parses and creates TCP/IP protocol packets…
permissive · top 5,000 on PyPI
rtpDecodes, encodes, and manipulates RTP…
permissive · top 15,000 on PyPI
pmd-net-protoParses, assembles, and validates network…
copyleft · top 15,000 on PyPI
aiortspProvides asyncio-based RTSP client…
copyleft · top 15,000 on PyPI