Skip to main content

Traceroute visualization on a world map

Project description

TraceViz

Visualize traceroute paths on a world map. Traceroute 路径可视化工具 —— 在世界地图上展示网络数据包的旅行路径。

PyPI Python License CI Ruff

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 pip
pip install traceviz

Homebrew formula coming soon.

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 / 工作原理

  1. Traceroute — runs the system traceroute / tracert command and parses each hop's IP and RTT
  2. IP Lookup — queries ipinfo.io for geolocation and ASN data; matches built-in backbone rules
  3. Analysis — detects latency spikes (>100 ms jump → possible ocean crossing) and classifies network segments
  4. Visualization — starts a local Flask server and renders the path on a Leaflet world map

Requirements / 系统要求

  • Python 3.12+
  • traceroute (macOS / Linux) or tracert (Windows, built-in)
    • Ubuntu / Debian: sudo apt install traceroute

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/

To publish a new version, tag and push — GitHub Actions will handle the PyPI release:

git tag v0.1.0
git push --tags

Before the first release, configure PyPI Trusted Publishing for this repository:

  1. If traceviz does not exist on PyPI yet, add a pending publisher for project traceviz.
  2. If it already exists, add a Trusted Publisher for repository shixy96/traceviz.
  3. Use workflow file .github/workflows/release.yml and environment pypi.

PyPI reference:

License

MIT

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

traceviz-0.1.0.tar.gz (51.2 kB view details)

Uploaded Source

Built Distribution

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

traceviz-0.1.0-py3-none-any.whl (23.8 kB view details)

Uploaded Python 3

File details

Details for the file traceviz-0.1.0.tar.gz.

File metadata

  • Download URL: traceviz-0.1.0.tar.gz
  • Upload date:
  • Size: 51.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for traceviz-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2f4e18b8585fa48a192d460aa9456c0315c82c1156e8b5a07cd2a5dc46bf3d9c
MD5 774a1c3391b56065559bf1ff75cab58f
BLAKE2b-256 16701fe7c112b1c4340e2f8f77fe7cbc780fb182c9c4a072bbe9d39d53472746

See more details on using hashes here.

Provenance

The following attestation bundles were made for traceviz-0.1.0.tar.gz:

Publisher: release.yml on shixy96/traceviz

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file traceviz-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: traceviz-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 23.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for traceviz-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1771bdc1e42a9d424e6c287cd878aafbf8c9498351b2a2cbec21ca5d636c8e88
MD5 1324d11d71d3cf42b53feb9a6c0fa5b2
BLAKE2b-256 4d5d2cbb3e3e6c83b236fc451962bd75dac395d744e2c98854aa85a081952027

See more details on using hashes here.

Provenance

The following attestation bundles were made for traceviz-0.1.0-py3-none-any.whl:

Publisher: release.yml on shixy96/traceviz

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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