Skip to main content

Drop-in replacement for PyBGPStream using BGPKIT

Project description

PyBGPFlux

Docs PyPI - Version CI License

A drop-in replacement for PyBGPStream using BGPKIT

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, bgpdump and pybgpstream single file backend (the latter three are system dependencies)
  • 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

PyBGPStream is great but the implementation is complex and stops working when UC San Diego experiences a power outage.
BGPKIT broker and parser are great, but cannot be used to create an ordered stream of BGP messages from multiple collectors and multiple data types.

Missing features

  • Live mode for RouteViews collectors
  • Some PyBGPStream data interface options like csv or sqlite

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pybgpflux-0.5.0.tar.gz (15.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pybgpflux-0.5.0-py3-none-any.whl (19.2 kB view details)

Uploaded Python 3

File details

Details for the file pybgpflux-0.5.0.tar.gz.

File metadata

  • Download URL: pybgpflux-0.5.0.tar.gz
  • Upload date:
  • Size: 15.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.22

File hashes

Hashes for pybgpflux-0.5.0.tar.gz
Algorithm Hash digest
SHA256 bd1b9ba837ff37ee531530e68f475f450d1c08cc9587f121afa3919605126046
MD5 f6417ab9d5eb3c74704327671ff82367
BLAKE2b-256 af857896cf98802504db2c49ce7050339c8cb6824615b8e30e692da360a4e0ea

See more details on using hashes here.

File details

Details for the file pybgpflux-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: pybgpflux-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 19.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.22

File hashes

Hashes for pybgpflux-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 571063ed187cb5eeeb1e8acf36c2b0efd369dacfc305fd76aa960016710807da
MD5 ea5466dfdd1e2170dbe510582cfeaf70
BLAKE2b-256 c04ff48f72f9838574fa2f98c3a63ff3e6301579fae36fb762254b76424e6022

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page