PyBGPFlux
A drop-in replacement for PyBGPStream using BGPKIT.
For a high-performance Rust library and CLI, check out bgpflux.
Features
- Generates time-ordered BGP messages on the fly from RIBs and updates MRT files of multiple collectors
- Stream the same BGP messages as PyBGPStream, enabling seamless, drop-in replacement
- Lazy loading consumes minimal memory, making it suitable for large datasets
- Multiple BGP parsers supported:
pybgpkit(default but slow),bgpkit-parser,bgpdumpandpybgpstreamsingle file backend (the latter three are system dependencies) - Multiple BGP archive brokers supported:
bgpkit(default, self-hostable),bgpstream,bgpfinder(self-hostable) - Caching with concurrent downloading fully compatible with the BGPKIT parser's caching functionality.
- Performance: for updates, typically 3–10× faster than PyBGPStream; for RIB-only processing, currently about 3–4× slower (see perf.md for test details).
- A CLI tool
Quick start
Installation:
pip install pybgpflux
Usage:
import datetime
from pybgpflux import BGPStreamConfig, BGPStream
config = BGPStreamConfig(
start_time=datetime.datetime(2010, 9, 1, 0, 0),
end_time=datetime.datetime(2010, 9, 1, 1, 59),
collectors=["route-views.wide", "rrc04"],
data_types=["ribs", "updates"],
)
stream = BGPStream.from_config(config)
n_elems = 0
for elem in stream:
n_elems += 1
print(f"Processed {n_elems} BGP elements")
or in the terminal:
pybgpflux --start-time 2010-09-01T00:00:00 --end-time 2010-09-01T01:59:00 --collectors route-views.sydney route-views.wide --data-types updates > updates.txt
Motivation
While PyBGPStream has long been the primary tool for streaming historical BGP data from multiple collectors, it is currently no longer actively maintained. New features are lagging (extended communities, RFC 9234) and the broker has become unreliable.
PyBGPFlux was developed to fill this gap, providing a modern, maintained alternative that restores these capabilities. PyBGPFlux is a library designed for maximum flexibility, utilizing Python to seamlessly integrate multiple parsers and brokers.
Missing features
- Live mode for RouteViews collectors
- Some PyBGPStream data interface options like csv or sqlite
Metadata
Release files for pybgpflux 0.5.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pybgpflux-0.5.2.tar.gz | 21.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pybgpflux-0.5.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 51.2 kB
Release files / pybgpflux-0.5.2.tar.gz
| Download URL | pybgpflux-0.5.2.tar.gz |
|---|---|
| Size | 21.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
21563adf9cef7036b92fbe36e5e8d7bdfb01fb9806105447af929bea343bf3df
|
|
BLAKE2b-256 checksum How to use checksums |
ffbfd85ba759b066533b998c4b0b98b2cab0d0ba59c7247836092d99beb26d8f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.11.22 {"installer":{"name":"uv","version":"0.11.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / pybgpflux-0.5.2-py3-none-any.whl
| Download URL | pybgpflux-0.5.2-py3-none-any.whl |
|---|---|
| Size | 29.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ad33ef4b3bce7a2d3fa23eb5b4a047e5353c4df4a5ff5ec60fb56b6b8a9b340b
|
|
BLAKE2b-256 checksum How to use checksums |
a2404a81bc648f222fd9b31297c934891fe8298f05870937b313e7411ca8639f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.11.22 {"installer":{"name":"uv","version":"0.11.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|