python-bgpstuff.net
python-bgpstuff.net is a Python library that interacts with the various BGP routing and RPKI functions available on bgpstuff.net. This version of the library (v3.0.0+) is designed to interface with the brand new BGPStuff v3 API.
Installation
pip install bgpstuff
Simple Demo
The v3 library is entirely stateless. Methods directly return the JSON response from the API instead of modifying properties on the client object.
import bgpstuff
# Initialize the client.
# You can optionally pass an API key to access higher rate limits.
client = bgpstuff.Client(api_key="bgs_yourapikeyhere")
# Query a route
route_info = client.get_route("8.8.8.8")
print(route_info)
# Query ROA status
roa_info = client.get_roa("1.1.1.1")
print(roa_info)
Rate Limiting
The BGPStuff v3 API enforces rate limiting server-side. This library features a built-in "smart rate limiter". It tracks the X-RateLimit-Remaining and X-RateLimit-Reset headers returned by the server on each request.
If you exhaust your allowed requests, the library will intelligently sleep until the reset timestamp before making the next request. This ensures you never overwhelm the backend, while seamlessly handling pauses for your application. If a 429 Too Many Requests is encountered unexpectedly, it will also gracefully back off and retry.
Documentation
Full documentation for all available endpoints and methods can be found at https://dev.bgpstuff.net/.
Metadata
Release files for bgpstuff 3.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 | |
|---|---|---|---|
| bgpstuff-3.0.0.tar.gz | 8.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| bgpstuff-3.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 18.2 kB
Release files / bgpstuff-3.0.0.tar.gz
| Download URL | bgpstuff-3.0.0.tar.gz |
|---|---|
| Size | 8.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
76080406a63b9d8873a996a5c8b7ac4f95e70a02421c79e5cafc71db3ea721f2
|
|
BLAKE2b-256 checksum How to use checksums |
f53cd801db037f81a096ad057fcd1c338ad83d958ad9abe63d7758db4e1078e9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Release files / bgpstuff-3.0.0-py3-none-any.whl
| Download URL | bgpstuff-3.0.0-py3-none-any.whl |
|---|---|
| Size | 9.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c4f15641f2fc92d642fc5b7b872f0933b3c22d54bc822be64b5c99ef5c326c9d
|
|
BLAKE2b-256 checksum How to use checksums |
3ab4fb05f1aabff975de078a18e67b657b8eae9684b37fdf997b6f2450bcc9f1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|