Skip to main content

Drop-in replacement for PyBGPStream using BGPKIT

Project description

PyBGPKITStream

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 pybgpkitstream

Usage:

import datetime
from pybgpkitstream import BGPStreamConfig, BGPKITStream

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 = BGPKITStream.from_config(config)

n_elems = 0
for elem in stream:
  n_elems += 1
    
print(f"Processed {n_elems} BGP elements")

or in the terminal:

pybgpkitstream --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

pybgpkitstream-0.4.2.tar.gz (14.1 kB view details)

Uploaded Source

Built Distribution

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

pybgpkitstream-0.4.2-py3-none-any.whl (17.9 kB view details)

Uploaded Python 3

File details

Details for the file pybgpkitstream-0.4.2.tar.gz.

File metadata

  • Download URL: pybgpkitstream-0.4.2.tar.gz
  • Upload date:
  • Size: 14.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","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}

File hashes

Hashes for pybgpkitstream-0.4.2.tar.gz
Algorithm Hash digest
SHA256 65fb9be74e66f3edf0fe0eefe5bdd420eec780d7512cc0e2b56015a40e3ba2dc
MD5 ce9abcd376463b39202c8852b77d3aca
BLAKE2b-256 845a5077b8a1865563d657f7c830f74ee7b3a0c95b22babd4dee59e6d33f2a2d

See more details on using hashes here.

File details

Details for the file pybgpkitstream-0.4.2-py3-none-any.whl.

File metadata

  • Download URL: pybgpkitstream-0.4.2-py3-none-any.whl
  • Upload date:
  • Size: 17.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","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}

File hashes

Hashes for pybgpkitstream-0.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d841b3eb0fb0881ed7778959f285d7811b575b44d59808941e7e5f1f4b76f408
MD5 b60c44ea49bfd4a2d763728f5b07f6bf
BLAKE2b-256 6234e0fcb8d3357e7b62d3dbcc28ac3d27f4e5f677fe3850e45ff7c3cd6f2d6a

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