Traceroute visualization on a world map
Project description
TraceViz
Visualize traceroute paths on a world map. Traceroute 路径可视化工具 —— 在世界地图上展示网络数据包的旅行路径。
Features / 功能特性
- Run traceroute and visualize each hop on an interactive world map
- Auto-detect Chinese ISP backbone segments (ChinaTelecom 163/CN2, ChinaUnicom CUNet, ChinaMobile CMI, etc.)
- Latency spike detection — automatically flag possible transoceanic hops
- Cross-platform: macOS / Linux / Windows
- ICMP and UDP probe modes
- Pure JSON output for scripting
- Built-in demo mode — try the frontend without running a real traceroute
Installation / 安装
# Recommended: using uv
uv tool install traceviz
# Or using Homebrew
brew install shixy96/tap/traceviz
# Or using pip
pip install traceviz
Usage / 使用
# Basic — trace to google.com and open the map in your browser
traceviz google.com
# ICMP mode (better penetration, requires sudo/admin)
sudo traceviz google.com --icmp
# JSON-only output
traceviz google.com --json
# Demo mode (simulated data)
traceviz --demo google.com
# Custom parameters
traceviz google.com --max-hops 20 --queries 3 --wait 3
# Use an ipinfo.io token for higher query limits
traceviz google.com --token YOUR_TOKEN
CLI Options
| Option | Description | Default |
|---|---|---|
target |
Target domain or IP address | (required) |
--max-hops |
Maximum number of hops | 30 |
--port |
Local server port | 8890 |
--token |
ipinfo.io API token | — |
--icmp |
Use ICMP mode | off |
--wait |
Timeout per hop (seconds) | 2 |
-q, --queries |
Probes per hop | 2 |
--json |
JSON output only, no server | off |
--demo |
Use simulated demo data | off |
How It Works / 工作原理
- Traceroute — runs the system
traceroute/tracertcommand and parses each hop's IP and RTT - IP Lookup — queries ipinfo.io for geolocation and ASN data; matches built-in backbone rules
- Analysis — detects latency spikes (>100 ms jump → possible ocean crossing) and classifies network segments
- Visualization — starts a local Flask server and renders the path on a Leaflet world map
Requirements / 系统要求
- Python 3.12+
traceroute(macOS / Linux) ortracert(Windows, built-in)- Ubuntu / Debian:
sudo apt install traceroute
- Ubuntu / Debian:
Development / 开发
# Clone
git clone https://github.com/shixy96/traceviz.git
cd traceviz
# Install dev dependencies
uv sync --extra dev
# Install locally as a tool
uv tool install .
# Run tests
uv run pytest
# Lint
uv run ruff check traceviz/ tests/
# Format check
uv run ruff format --check traceviz/ tests/
To publish a new version:
- Land the release changes on
main, including the new value intraceviz/__init__.py. - Use a Conventional Commit PR title because squash merge will reuse it as the final commit subject.
- Pull the latest clean
mainlocally. - Run the release script from
main.
git checkout main
git pull --ff-only origin main
./scripts/tag-release.sh
The script requires git-cliff, generates and commits CHANGELOG.md, creates v<version>, and pushes both the release commit and tag to origin.
GitHub Actions then builds the package, publishes to PyPI, updates the Homebrew tap, and creates the GitHub Release.
Release automation prerequisites:
- PyPI Trusted Publishing is configured for repository
shixy96/traceviz. - Create repository
shixy96/homebrew-tap. - Add repository secret
HOMEBREW_TAP_TOKENinshixy96/traceviz. - The token needs
Contents: Read and writeonshixy96/homebrew-tap. - Install
git-cliffon the machine that runs./scripts/tag-release.sh.
PyPI reference:
Homebrew install:
brew tap shixy96/tap
brew install traceviz
License
Project details
Release history Release notifications | RSS feed
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 traceviz-0.1.3.tar.gz.
File metadata
- Download URL: traceviz-0.1.3.tar.gz
- Upload date:
- Size: 63.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c389868b8032ed4cc94a30a0117749d67117ef2b9607ac848d91a69e9fc8649c
|
|
| MD5 |
75363819b8909c978895607a1e4b116b
|
|
| BLAKE2b-256 |
6ff8a655838109d5b1d42eb393ec466bf4e62403e35a34d11754281e3cb35cbf
|
Provenance
The following attestation bundles were made for traceviz-0.1.3.tar.gz:
Publisher:
release.yml on shixy96/traceviz
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
traceviz-0.1.3.tar.gz -
Subject digest:
c389868b8032ed4cc94a30a0117749d67117ef2b9607ac848d91a69e9fc8649c - Sigstore transparency entry: 1094569481
- Sigstore integration time:
-
Permalink:
shixy96/traceviz@13d7812c91ad70faacc991bcf9451fe5bb21d9b1 -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/shixy96
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@13d7812c91ad70faacc991bcf9451fe5bb21d9b1 -
Trigger Event:
push
-
Statement type:
File details
Details for the file traceviz-0.1.3-py3-none-any.whl.
File metadata
- Download URL: traceviz-0.1.3-py3-none-any.whl
- Upload date:
- Size: 24.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c3d28218c8510bde8a26d6bcdcf80876122e5e7b8658b5ee27704da1bb086dca
|
|
| MD5 |
b004d91d345b7ba42a01dda96fe1c94f
|
|
| BLAKE2b-256 |
320f96d038899d65d88802323ef5f8b632f41c06e42bdcb8083eb3b3e5c4a123
|
Provenance
The following attestation bundles were made for traceviz-0.1.3-py3-none-any.whl:
Publisher:
release.yml on shixy96/traceviz
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
traceviz-0.1.3-py3-none-any.whl -
Subject digest:
c3d28218c8510bde8a26d6bcdcf80876122e5e7b8658b5ee27704da1bb086dca - Sigstore transparency entry: 1094569497
- Sigstore integration time:
-
Permalink:
shixy96/traceviz@13d7812c91ad70faacc991bcf9451fe5bb21d9b1 -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/shixy96
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@13d7812c91ad70faacc991bcf9451fe5bb21d9b1 -
Trigger Event:
push
-
Statement type: