Simple asynchronous traceroute
Dead simple module which provides asynchronous traceroute with asynchronous dns resolution.
Needs root privileges to be executed (for raw socket)
Installation
pip install aiotraceroute
Example
import asyncio
from aiotraceroute import aiotraceroute
async def main(dest):
# print hop by hop
async for n, addr, host in aiotraceroute(dest):
print(n, addr, host)
# Or run it without iterating
tr = aiotraceroute(dest)
result = await tr.run()
print(result)
asyncio.get_event_loop().run_until_complete(main("google.com"))
API
The aiotraceroute function takes the following arguments:
dest: Traceroute destination, can either be a hostname or an IP address.port: Destination port (optionnal, default: 33434)max_hops: Maximum number of hops before reaching final destination (optionnal, default: 30)timeout: Timeout between each hop (optionnal: default: 1s)packet_size: Pakcte size in bytes to send each time (optionnal: default: 60)
The run() method runs the traceroute and returns a list of tuples containing hop_number, address or None, hostname or None
Python versions
Python >= 3.6 are supported
Tests
This project uses unittest.
Run make init then sudo make test
Metadata
Release files for aiotraceroute 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| aiotraceroute-1.0.0.tar.gz | 3.1 kB | Without provenance | Details for aiotraceroute-1.0.0.tar.gz |
Release files / aiotraceroute-1.0.0.tar.gz
| Download URL | aiotraceroute-1.0.0.tar.gz |
|---|---|
| Size | 3.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e6022d51bca5dfbf54c30cdb8523d7b659c08253bd8092858c9bbd4ea0c0ccd7
|
|
BLAKE2b-256 checksum How to use checksums |
a1204431f80843d64bf632a9b81a82223de2d8c9f5f5b8fc4e91ecd958cb8749
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.6.9
|
Security for aiotraceroute 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.