Beautiful CLI network diagnostics — ping, traceroute, network scanning, port scanning, TCP checks, and DNS lookup
Project description
xping
Beautiful CLI network diagnostics — ping, traceroute, network scanning, port scanning, TCP checks, and DNS lookup.
Zero external Python dependencies. Pure stdlib. Linux, macOS & Windows.
██╗ ██╗██████╗ ██╗███╗ ██╗ ██████╗
╚██╗██╔╝██╔══██╗██║████╗ ██║██╔════╝
╚███╔╝ ██████╔╝██║██╔██╗ ██║██║ ███╗
██╔██╗ ██╔═══╝ ██║██║╚██╗██║██║ ██║
██╔╝ ██╗██║ ██║██║ ╚████║╚██████╔╝
╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═══╝ ╚═════╝
network diagnostics · beautiful by default
Created by Meh Askari — see LICENSE for attribution terms.
Features
- Ping — Live per-packet latency bars, animated spinner, sparkline chart, full statistics
- Traceroute — Real-time hop-by-hop path with RTT colour coding and summary
- DNS Lookup — A, AAAA, MX, NS, TXT (SPF / DMARC / DKIM) with reverse DNS
- TCP Connect — Live TCP port checks with connect timing, success rate, and timeline
- Port Scanner — Concurrent TCP port scans with service names and open-port summary
- IP Scan — Discover live hosts across CIDR blocks or IP ranges using ICMP echo probes
- IP Sweep — Scan CIDR blocks or IP ranges for hosts with open TCP services
- All-in-one — Run lookup, ping, trace, and TCP checks in a single command
- Dependency checker —
xping depsdetects missing tools and shows the correct install command for your distro - Zero Python deps — stdlib only (Python ≥ 3.10)
- True-colour output — ANSI 24-bit colour, animated spinners, live sparklines
- man page included —
man xpingworks after installation - Machine-readable export —
--json,--csv, and--markdownon every diagnostic command
Windows
XPing is a first-class citizen on Windows. TCP, port scan, sweep, and DNS fallback work out of the box with Python 3.10+.
For ICMP ping and traceroute, install the built-in optional tools or let xping use subprocess fallbacks:
pipx install xping
xping ping 1.1.1.1
xping trace cloudflare.com
xping deps
xping deps prints install hints for missing ping, tracert, and dig when available through winget or chocolatey.
Installation
Ubuntu / Debian / Linux Mint / Pop!_OS — PPA (recommended)
sudo add-apt-repository ppa:mehdiaskari/xping
sudo apt update
sudo apt install python3-xping
Supported: Ubuntu 22.04 LTS, 24.04 LTS, Linux Mint 21+, Pop!_OS 22.04+
PyPI (all platforms)
pipx install xping
From source
git clone https://github.com/mehaskari/xping
cd xping
pip install .
Arch Linux (AUR)
yay -S python-xping
Manual page (source installs)
sudo cp man/xping.1 /usr/share/man/man1/
sudo gzip /usr/share/man/man1/xping.1
sudo mandb
man xping
Usage
xping <command> <host> [options]
Ping
xping ping google.com
xping ping 1.1.1.1 -c 10 # 10 packets
xping ping example.com -i 0.2 # 200 ms interval
xping ping host.local -t 5 # 5 s timeout
Traceroute
xping trace google.com
xping trace 8.8.8.8 --max-hops 15
xping trace example.com --probes 5
DNS Lookup
xping lookup github.com
xping lookup github.com --full # includes TXT / SPF / DMARC / DKIM
TCP Connectivity
xping tcp example.com 443
xping tcp db.internal 5432 -c 5 # 5 connection attempts
xping tcp api.example.com 8443 -t 3 -i 1
Port Scan
xping portscan example.com
xping portscan example.com --ports 22,80,443
xping portscan 10.0.0.5 --ports 1-1024 -t 0.3 -w 200
IP Scan
xping ipscan 192.168.1.0/24
xping ipscan 10.0.0.10-10.0.0.50 -t 0.5 -w 128
xping ipscan 172.16.0.0/24 --limit 512
IP Sweep
xping sweep 192.168.1.0/24
xping sweep 10.0.0.10-10.0.0.50 --ports 22,80,443
xping sweep 172.16.0.0/24 --ports 3389,5985 --limit 512
All at once
xping all cloudflare.com
xping all example.com --json
Runs full DNS lookup, 4-packet ping, traceroute, and TCP checks on ports 443 and 80.
Export formats
Every diagnostic command accepts structured output flags (interactive rendering is suppressed):
xping ping 1.1.1.1 --json
xping trace example.com --csv
xping lookup github.com --full --markdown
xping all cloudflare.com --json
Dependency check
xping deps
Permissions
ICMP raw sockets require root or cap_net_raw. Without them xping
automatically falls back to the system ping / traceroute binaries.
Grant capability without running as root:
sudo setcap cap_net_raw+ep $(which xping)
Environment variables
| Variable | Effect |
|---|---|
NO_COLOR |
Disable all ANSI colour output |
XPING_DEBUG |
Print full Python tracebacks on errors |
Contributing
- Fork and clone the repository
pip install -e ".[dev]"- Make your changes
- Run
python -m pytest tests/ - Open a pull request
License
MIT with Mandatory Attribution — see LICENSE.
Any fork, derivative work, or redistribution must visibly credit Meh Askari <mehdiaskari@outlook.com>.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file xping-1.2.5.tar.gz.
File metadata
- Download URL: xping-1.2.5.tar.gz
- Upload date:
- Size: 66.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
412cc6c7f30af0c52019654335e6649cc5bf7579585da6a0bc73e9ca477a0801
|
|
| MD5 |
7ccd12fee13ad1a20a8d9c8a1394b092
|
|
| BLAKE2b-256 |
9cba5bf7ffbea46fe2f0d1ec19181a981161f874f53e95fbc57161fb560b9af9
|
File details
Details for the file xping-1.2.5-py3-none-any.whl.
File metadata
- Download URL: xping-1.2.5-py3-none-any.whl
- Upload date:
- Size: 82.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b227cc89de3f1020d2f68c78fe4e4bbac4edeb1ae121185681e95b8f59c1438d
|
|
| MD5 |
e8790c578d9650cadb8942f6cc7dc773
|
|
| BLAKE2b-256 |
8412a1f289130a41c6cc4f7e17537ffc36036e816339cf4131022ccaa4d1a771
|