skillfed

pythonping

A simple way to ping in Python

pythonping v1.1.4 492.4K downloads/30d#6,359 on PyPI207
Permissive license MIT DORMANT released

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 pythonping

uv

uv add pythonping

poetry

poetry add pythonping

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: System AdministratorsNatural Language :: English

Tags

icmp ping from pythonnetwork reachability testingsend ping packets programmaticallyhost latency measurementpython icmp clientnetwork diagnostics libraryremote host availability check
network-diagnosticsicmprequires-root

More Networking packages