icmplib
Easily forge ICMP packets and make your own ping and traceroute.
What it is and what it does
icmplib is a pure Python ICMP protocol implementation that lets you send ping requests, perform concurrent multiping operations, and run traceroute diagnostics without external dependencies. It works with both IPv4 and IPv6 addresses, supports asynchronous operations via asyncio, and can run in either privileged mode (full packet control, typically requires root) or unprivileged mode (kernel-managed, no special privileges needed).
The library is designed for developers who need to build network diagnostics tools, monitor host reachability, or implement custom ICMP-based applications. It provides ready-to-use functions like `ping()`, `multiping()`, and `traceroute()` for common tasks, as well as low-level socket classes (`ICMPv4Socket`, `ICMPv6Socket`) for building custom implementations. Cross-platform support for Linux, macOS, and Windows is built in.
Use it for:
- Check if a host is reachable and measure latency with ping() or async_ping() in monitoring scripts
- Perform concurrent reachability checks on multiple hosts using multiping() for network surveys
- Build network diagnostics tools that trace the path packets take to a destination with traceroute()
- Implement custom ICMP-based applications by working directly with ICMPv4Socket and ICMPv6Socket classes
- Monitor network quality metrics like jitter and packet loss in real-time applications
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
icmplib provides a pure Python implementation of the ICMP protocol for sending ping, multiping, and traceroute requests, with support for both IPv4 and IPv6, synchronous and asynchronous operations, and custom socket-level control.
Yes, for network diagnostics and monitoring tasks. The package is stable, dependency-free, and widely used (top 5000 on PyPI). The main consideration is that maintenance is dormant as of the fact sheet date—verify compatibility with your Python version and that any security or compatibility issues with recent Python releases have been addressed before adopting in production.
Install
icmplib on PyPI
pip
pip install icmplibuv
uv add icmplibpoetry
poetry add icmplibInstalling icmplib
Before you install
Installation is straightforward with no external dependencies. The package is marked Production/Stable and has been actively maintained since 2019, though the last release was in October 2023 and the repository shows dormant status as of the fact sheet date.
License in practice
Licensed under GNU Lesser General Public License v3.0 (copyleft). You may use and modify the library freely, but any derivative works must also be licensed under LGPLv3 and source code must be made available to recipients.
Quickstart
pip install icmplib
from icmplib import ping
host = ping('1.1.1.1', count=4)
print(f"Host {host.address} is alive: {host.is_alive}")
print(f"Average RTT: {host.avg_rtt} ms")
Requires Python 3.7 or later. On Unix systems, privileged mode (default) requires root or appropriate capabilities; unprivileged mode available but requires kernel support.
Verify before relying
- Whether the dormant maintenance status (last release October 2023) affects stability or security for current Python versions
- Specific behavior differences between privileged and unprivileged modes on different operating systems
Package facts
| License | GNU Lesser General Public License v3.0 (copyleft) |
| Python support | supports the current Python release (>=3.7) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | dormant — 1,039 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,194,341/month — #4,234 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: icmplib-3.0.4-py3-none-any.whl
Keywords: icmp, sockets, ping, multiping, traceroute, async, asyncio, ipv4, ipv6, python, python3
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
multipingMultiPing sends ICMP echo requests (pings) to…
permissive · top 15,000 on PyPI
python-oscpython-osc implements Open Sound Control (OSC)…
unclear · top 15,000 on PyPI
ping3Ping3 sends ICMP echo requests to hosts and…
permissive · top 15,000 on PyPI
pythonpingSends ICMP ping requests to remote hosts from…
permissive · top 15,000 on PyPI
aiopingaioping provides an asyncio-based ICMP ping…
copyleft · top 15,000 on PyPI
pingparsingExecutes and parses ping command output,…
permissive · top 15,000 on PyPI
pmd-pytcpA pure-Python TCP/IP stack (Ethernet through…
copyleft · top 15,000 on PyPI
netaddrRepresents and manipulates IPv4, IPv6, MAC…
permissive · top 5,000 on PyPI
rtpDecodes, encodes, and manipulates RTP…
permissive · top 15,000 on PyPI
pyroute2Pyroute2 is a pure Python networking framework…
unclear · top 5,000 on PyPI