Beautiful CLI network diagnostics โ ping, traceroute, and DNS lookup
Project description
xping ๐
Beautiful CLI network diagnostics โ ping, traceroute, and DNS lookup.
Zero external dependencies. Pure Python stdlib. Works on Linux and macOS.
โโโ โโโโโโโโโโ โโโโโโโ โโโ โโโโโโโ
โโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโ
โโโโโโ โโโโโโโโโโโโโโโโโ โโโโโโ โโโโ
โโโโโโ โโโโโโโ โโโโโโโโโโโโโโโโ โโโ
โโโโ โโโโโโ โโโโโโ โโโโโโโโโโโโโโโ
โโโ โโโโโโ โโโโโโ โโโโโ โโโโโโโ
network diagnostics ยท beautiful by default
Features
- Ping โ ICMP echo with live latency bars, sparkline chart, and statistics
- Traceroute โ Hop-by-hop path with RTT coloring and summary
- DNS Lookup โ A, AAAA, MX, NS, TXT (SPF/DMARC/DKIM) records
- All-in-one โ Run all three in one command
- Zero dependencies โ stdlib only (Python โฅ 3.10)
- Beautiful output โ True-colour ANSI, tables, sparklines, badges
Installation
From PyPI
pip install xping
From source
git clone https://github.com/mehaskari/xping
cd xping
pip install .
On Arch Linux (AUR)
yay -S python-xping
On Debian / Ubuntu (manual .deb)
# Build the wheel first, then install with pipx for clean isolation
pipx install 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 # 200ms interval
xping ping host.local -t 5 # 5s 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
All at once
xping all cloudflare.com
Permissions
ICMP raw sockets require either:
- Running as root (
sudo xping ping โฆ) - The
cap_net_rawcapability:sudo setcap cap_net_raw+ep $(which xping)
Without these, xping automatically falls back to the system ping / traceroute
binaries, so it always works.
Output samples
Ping
โ PING google.com
Target google.com
IP address 142.250.185.78
Packets 5
[ 1] โ 142.250.185.78 โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ 42.11 ms
[ 2] โ 142.250.185.78 โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ 40.87 ms
...
โโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโ
โ Metric โ Value โ
โโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโค
โ Packets sent โ 5 โ
โ Packets recv โ 5 โ
โ Packet loss โ 0.0% โ
โ Min RTT โ 38.22 ms โ
โ Avg RTT โ 41.05 ms โ
โ Max RTT โ 44.91 ms โ
โ Jitter โ 1.83 ms โ
โโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโ
Latency sparkline:
โ
โโ
โ
โ
DNS Lookup
โ DNS LOOKUP github.com
โโ IPv4 (A records) โโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโ
โ IPv4 Address โ Reverse DNS โ TTL โ
โโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโค
โ 140.82.121.4 โ lb-140-82-121-4.g... โ 60s โ
โโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโ
Environment variables
| Variable | Effect |
|---|---|
NO_COLOR |
Disable all ANSI colour output |
XPING_DEBUG |
Print full tracebacks on errors |
Contributing
- Fork and clone the repo
pip install -e ".[dev]"- Make your changes
- Run
python -m pytest tests/ - Open a pull request
License
MIT โ see LICENSE
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.0.2.tar.gz.
File metadata
- Download URL: xping-1.0.2.tar.gz
- Upload date:
- Size: 22.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7b3c4d2c5db78f2dce30d552cc7b5fb085d6798cc801b002ec317e496f9a82e6
|
|
| MD5 |
90818e330481bb5856f69eccd4cc34ad
|
|
| BLAKE2b-256 |
fcec7a5769849e579d5f4812dc405df6245797c6af396f4f7419cb0e85eca115
|
File details
Details for the file xping-1.0.2-py3-none-any.whl.
File metadata
- Download URL: xping-1.0.2-py3-none-any.whl
- Upload date:
- Size: 22.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2347e92f8c88c19a07233562ec89181f18ecd545844853e12151861f151186ea
|
|
| MD5 |
62f3b724635d4dbf134d1eba9fca37d8
|
|
| BLAKE2b-256 |
c9c6c1d099999865fd087e58ebe43f748e5d9afb04805128d074b261f4292eb3
|