skillfed

icmplib

Easily forge ICMP packets and make your own ping and traceroute.

icmplib v3.0.4 1.2M downloads/30d#4,234 on PyPI308
Copyleft license GNU Lesser General Public License v3.0 DORMANT released

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 icmplib

uv

uv add icmplib

poetry

poetry add icmplib

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)Operating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: LibrariesTopic :: Software Development :: Libraries :: Python Modules

Tags

ping library pythonicmp protocol implementationnetwork diagnostics pythontraceroute pythonasync pingipv6 ping supportmultiping concurrentraw icmp sockets
network-diagnosticsasync-ioipv6-ready

More Libraries packages