--- id: ping3 version: "5.1.5" license: MIT license_treatment: permissive maintenance: active --- # ping3 — A pure python3 version of ICMP ping implementation using raw socket. License: permissive · Maintenance: active · Downloads: 786.3K/mo ## What it is and what it does Ping3 is a pure Python implementation of ICMP ping that uses raw sockets to send echo requests and measure network latency. It works with both IPv4 and IPv6 addresses, supports custom timeouts, packet sizes, TTL values, and source addresses or interfaces. The package offers both a programmatic API (ping and verbose_ping functions) and a command-line tool. The main use case is network diagnostics and connectivity testing from within Python applications without spawning external ping processes. It returns the round-trip delay as a float, False when a host cannot be resolved, or None on timeout. Optional DEBUG and EXCEPTIONS modes provide detailed packet inspection or exception-based error handling instead of return values. Use it for: - Check if a remote host is reachable and measure latency before attempting a connection. - Monitor network connectivity in a background service or health-check daemon. - Diagnose network issues by pinging multiple hosts with custom timeouts and TTL values. - Build a network topology or reachability map by pinging a range of IP addresses. - Test IPv6 connectivity explicitly or auto-detect the appropriate protocol version. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Ping3 sends ICMP echo requests to hosts and measures round-trip time using raw sockets, returning latency in seconds or milliseconds or None on timeout. Yes, if you need ICMP ping from Python and can work with the privilege requirement. The package is stable, actively maintained, has no external dependencies, and carries permissive licensing. It is well-suited for network diagnostics and connectivity checks in applications or scripts. The main gotcha is that most platforms require root or administrator privileges to send raw ICMP packets. ## Install pip install ping3 uv add ping3 poetry add ping3 ## Installing ping3 Before you install: Low install friction with no runtime dependencies. Active maintenance with recent commits and a stable release history since 2017. Requires Python 3.5 or later. License in practice: MIT license permits unrestricted use, modification, and distribution with minimal obligations, making it safe for commercial and private projects. Quickstart: pip install ping3 from ping3 import ping delay = ping('example.com') # Returns delay in seconds, False if host unknown, None if timeout print(delay) On most platforms, sending ICMP packets requires root or administrator privileges; some systems may need `sudo ping3` or equivalent elevated permissions. Verify before relying: - Whether the package works reliably across Windows, macOS, and Linux without platform-specific workarounds beyond privilege requirements. - Performance characteristics when pinging many hosts concurrently or in rapid succession. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 786.3K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags icmp ping python, network latency measurement, host reachability check, raw socket ping, python ping library, network diagnostics tool, ip connectivity test, network-diagnostics, icmp, raw-sockets [View on SkillFed](https://skillfed.io/packages/ping3) · [View on PyPI](https://pypi.org/project/ping3/)