Python Client for Connecting to BGPStuff.net
Project description
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/.
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 bgpstuff-3.0.0.tar.gz.
File metadata
- Download URL: bgpstuff-3.0.0.tar.gz
- Upload date:
- Size: 8.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
76080406a63b9d8873a996a5c8b7ac4f95e70a02421c79e5cafc71db3ea721f2
|
|
| MD5 |
a72f4c1a14de57ebb1fa9cb67d606d77
|
|
| BLAKE2b-256 |
f53cd801db037f81a096ad057fcd1c338ad83d958ad9abe63d7758db4e1078e9
|
File details
Details for the file bgpstuff-3.0.0-py3-none-any.whl.
File metadata
- Download URL: bgpstuff-3.0.0-py3-none-any.whl
- Upload date:
- Size: 9.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c4f15641f2fc92d642fc5b7b872f0933b3c22d54bc822be64b5c99ef5c326c9d
|
|
| MD5 |
1c8f5b89b0c0c6ed58bd77e7ae051021
|
|
| BLAKE2b-256 |
3ab4fb05f1aabff975de078a18e67b657b8eae9684b37fdf997b6f2450bcc9f1
|