netpath 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- netpath/__init__.py +1 -0
- netpath/__main__.py +3 -0
- netpath/asn.py +108 -0
- netpath/cli.py +526 -0
- netpath/country.py +134 -0
- netpath/diagnosis.py +93 -0
- netpath/display.py +473 -0
- netpath/globe.py +205 -0
- netpath/iperf.py +59 -0
- netpath/mtr.py +197 -0
- netpath/rum.py +55 -0
- netpath/servers.py +69 -0
- netpath/speedtest.py +112 -0
- netpath-0.1.0.dist-info/METADATA +135 -0
- netpath-0.1.0.dist-info/RECORD +18 -0
- netpath-0.1.0.dist-info/WHEEL +4 -0
- netpath-0.1.0.dist-info/entry_points.txt +2 -0
- netpath-0.1.0.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: netpath
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Network path analyzer: throughput, latency, and packet loss across AS paths
|
|
5
|
+
Project-URL: Homepage, https://github.com/holynakamoto/netpath
|
|
6
|
+
Project-URL: Bug Tracker, https://github.com/holynakamoto/netpath/issues
|
|
7
|
+
Author-email: Nick Moore <nickm@dave.io>
|
|
8
|
+
License: MIT
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Classifier: Development Status :: 4 - Beta
|
|
11
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
12
|
+
Classifier: Operating System :: OS Independent
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
19
|
+
Classifier: Topic :: System :: Networking :: Monitoring
|
|
20
|
+
Requires-Python: >=3.9
|
|
21
|
+
Requires-Dist: requests>=2.28
|
|
22
|
+
Requires-Dist: rich>=13.0
|
|
23
|
+
Requires-Dist: typer>=0.9
|
|
24
|
+
Description-Content-Type: text/markdown
|
|
25
|
+
|
|
26
|
+
# netpath
|
|
27
|
+
|
|
28
|
+
Network path analyzer: probe throughput, latency, and packet loss across Autonomous System (AS) paths. Runs mtr/traceroute to a target ASN, measures bidirectional iperf3 throughput to servers inside that ASN, and optionally overlays Cloudflare Radar RUM data for comparison.
|
|
29
|
+
|
|
30
|
+
## Installation
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
pip install netpath
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
uvx netpath
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
uv tool install netpath
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## System Prerequisites
|
|
45
|
+
|
|
46
|
+
netpath relies on two external tools for path probing and throughput measurement. Install them before running:
|
|
47
|
+
|
|
48
|
+
- **mtr** — primary path prober (falls back to traceroute if unavailable)
|
|
49
|
+
- **iperf3** — bidirectional throughput measurement (falls back to Cloudflare HTTP speedtest if unavailable)
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
# macOS
|
|
53
|
+
brew install mtr iperf3
|
|
54
|
+
|
|
55
|
+
# Debian / Ubuntu
|
|
56
|
+
sudo apt install mtr-tiny iperf3
|
|
57
|
+
|
|
58
|
+
# Fedora / RHEL
|
|
59
|
+
sudo dnf install mtr iperf3
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Usage
|
|
63
|
+
|
|
64
|
+
### Probe a specific ASN
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
netpath asn AS15169
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Options:
|
|
71
|
+
|
|
72
|
+
```
|
|
73
|
+
-n, --count INTEGER Max servers to test (default: 3)
|
|
74
|
+
-d, --duration INTEGER iperf3 seconds per direction (default: 5)
|
|
75
|
+
-c, --cycles INTEGER mtr probe cycles (default: 10)
|
|
76
|
+
--no-throughput Skip throughput test, trace path only
|
|
77
|
+
--cf-token TEXT Cloudflare API token (or set NETPATH_CF_TOKEN)
|
|
78
|
+
--json Output results as JSON
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Probe top ASNs for a country
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
netpath country US
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Options:
|
|
88
|
+
|
|
89
|
+
```
|
|
90
|
+
-t, --top INTEGER Number of top ASNs to test (default: 10)
|
|
91
|
+
-n, --count INTEGER Max servers per ASN (default: 3)
|
|
92
|
+
-d, --duration INTEGER iperf3 seconds per direction (default: 5)
|
|
93
|
+
-c, --cycles INTEGER mtr probe cycles (default: 10)
|
|
94
|
+
--no-throughput Skip throughput test
|
|
95
|
+
--cf-token TEXT Cloudflare API token (or set NETPATH_CF_TOKEN)
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### Examples
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
# Probe Google's ASN
|
|
102
|
+
netpath asn AS15169
|
|
103
|
+
|
|
104
|
+
# Probe top 5 UK ISPs
|
|
105
|
+
netpath country GB --top 5
|
|
106
|
+
|
|
107
|
+
# Path-only probe (no throughput test)
|
|
108
|
+
netpath asn AS7018 --no-throughput
|
|
109
|
+
|
|
110
|
+
# JSON output for scripting
|
|
111
|
+
netpath asn AS15169 --json | jq .verdict
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
## Cloudflare Radar RUM Overlay
|
|
115
|
+
|
|
116
|
+
netpath can overlay Cloudflare Radar Real User Monitoring (RUM) quality metrics for each ASN, showing real-world HTTP performance data alongside your own measurements.
|
|
117
|
+
|
|
118
|
+
To enable it, pass a Cloudflare API token with `radar:read` permission:
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
export NETPATH_CF_TOKEN=your_token_here
|
|
122
|
+
netpath asn AS15169
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Or pass it inline:
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
netpath asn AS15169 --cf-token your_token_here
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
Tokens are free. Create one in the [Cloudflare dashboard](https://dash.cloudflare.com/profile/api-tokens) with the `radar:read` permission scope.
|
|
132
|
+
|
|
133
|
+
## License
|
|
134
|
+
|
|
135
|
+
MIT
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
netpath/__init__.py,sha256=kUR5RAFc7HCeiqdlX36dZOHkUI5wI6V_43RpEcD8b-0,22
|
|
2
|
+
netpath/__main__.py,sha256=O7gesm5VkMQ65kHiFV8s52RkcKplMxRJ4nbFJTXxjaY,35
|
|
3
|
+
netpath/asn.py,sha256=7TFIjMVnyl-MUxJPeyqg1KHTsgna1_0ScwF9q7mxFWA,3327
|
|
4
|
+
netpath/cli.py,sha256=1vdvrn0kF81V91rxFf0CsyUOtQF02C7ja4jiA4w8nMc,21712
|
|
5
|
+
netpath/country.py,sha256=LG8PppIOXcGy7mYNVwzB899G4Tr_SUfnwj4ICBc1h4M,4622
|
|
6
|
+
netpath/diagnosis.py,sha256=iAqdOP95Nan-TYG3b9yS9N0Qcc9NNPl4vxZxfArK1YQ,3818
|
|
7
|
+
netpath/display.py,sha256=tiZ-Nw4Ptc4g7gf6u9aF7MLbDdSsySf_DuuMcyc_5I0,16505
|
|
8
|
+
netpath/globe.py,sha256=7a9f_Ink7AkhTKO2uDd8Hz591VFLj5tVFJi_TF8s4ME,6924
|
|
9
|
+
netpath/iperf.py,sha256=w7IZCzcbRjsi-HndM-GdEEoUzq3NybUFBQU8qq2uZf4,1869
|
|
10
|
+
netpath/mtr.py,sha256=Nf5HKrm1cdwX0FURbBTStlPs3QZFRJXpkYYKrxUkjyk,6298
|
|
11
|
+
netpath/rum.py,sha256=eFYgXvlzUplQc0EtXNe5BxGJmbGJ_FbQHznzqBXs2cw,1678
|
|
12
|
+
netpath/servers.py,sha256=45wTNyCnw12Sf2-gJngDu6ZVCh95MyvupKTh0tYXxjY,2102
|
|
13
|
+
netpath/speedtest.py,sha256=muVLXt4w81CE_0GMNq8rhZzpbB5b_zpyJ177V2LZrRs,3369
|
|
14
|
+
netpath-0.1.0.dist-info/METADATA,sha256=0torS0_wf5VpZnKSPO3as7v7Zm_UCceOUnCO04oRdT0,3627
|
|
15
|
+
netpath-0.1.0.dist-info/WHEEL,sha256=mffPy8wBnZQn2VnJUU5jE99KsxaSfiyMHV9Yt0aLVxs,87
|
|
16
|
+
netpath-0.1.0.dist-info/entry_points.txt,sha256=NMuWiG1KEZIdFYL_ocRBE3WGFnQsVonfiS78WtYzuXU,44
|
|
17
|
+
netpath-0.1.0.dist-info/licenses/LICENSE,sha256=iA0PlTyHGQVbvbs5Ik49HKKV3zRpCKjH1YSJxt48y5g,1067
|
|
18
|
+
netpath-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Nick Moore
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|