Skip to main content

Beautiful CLI network diagnostics — ping, traceroute, and DNS lookup

Project description

xping

Beautiful CLI network diagnostics — ping, traceroute, and DNS lookup.

Zero external Python dependencies. Pure stdlib. Linux & macOS.

  ██╗  ██╗██████╗ ██╗███╗   ██╗ ██████╗
  ╚██╗██╔╝██╔══██╗██║████╗  ██║██╔════╝
   ╚███╔╝ ██████╔╝██║██╔██╗ ██║██║  ███╗
   ██╔██╗ ██╔═══╝ ██║██║╚██╗██║██║   ██║
  ██╔╝ ██╗██║     ██║██║ ╚████║╚██████╔╝
  ╚═╝  ╚═╝╚═╝     ╚═╝╚═╝  ╚═══╝ ╚═════╝
  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
  • All-in-one — Run all three in a single command
  • Dependency checkerxping deps detects 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 includedman xping works after installation

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

All at once

xping all cloudflare.com

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

  1. Fork and clone the repository
  2. pip install -e .
  3. Make your changes
  4. Run python -m pytest tests/
  5. 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

xping-1.0.3.tar.gz (23.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xping-1.0.3-py3-none-any.whl (24.7 kB view details)

Uploaded Python 3

File details

Details for the file xping-1.0.3.tar.gz.

File metadata

  • Download URL: xping-1.0.3.tar.gz
  • Upload date:
  • Size: 23.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for xping-1.0.3.tar.gz
Algorithm Hash digest
SHA256 faede179a16d5a13a951a0b79496fc4317bacfa7e23e4394f20b532ffd739f1b
MD5 aa26b6fbf13cc7e3bd318dff890b45d4
BLAKE2b-256 d1c6125dadc1cb40a84b9f2216d0fcc2bd93c49b3ad9b4dd8657210a373c6dc7

See more details on using hashes here.

File details

Details for the file xping-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: xping-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 24.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for xping-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 fb702fc9b6c112550f8950e5ed8eedfde0e09995874f94f23c9da72859bfc5aa
MD5 bafacb61cc5e81f57b3d8f10ea60d97e
BLAKE2b-256 708b3c659f35f98743bf88b2c696c14b673985322824e2bb2fc36894cb263faa

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page