skillfed

pybgpkit

BGPKIT tools Python bindings

pybgpkit v0.8.0 103.3K downloads/30d#12,813 on PyPI19
Permissive license MIT Active released

What it is and what it does

PyBGPKit is a Python wrapper around BGPKIT, a suite of tools for working with Border Gateway Protocol (BGP) data. It provides bindings to parse BGP update messages from MRT files, query historical BGP data from public archives, and perform IP/ASN/ROAS lookups against BGP information sources. The package exposes several APIs: a full-featured Parser for detailed BGP element extraction with filtering, a faster RouteParser for route-level data, a Broker for searching and retrieving MRT files by time range and collector, and lookup classes for IP geolocation, ASN details, BGP communities, and RPKI ROAS validation.

The package is designed for network operators, security researchers, and BGP analysts who need programmatic access to BGP routing data. It depends on pybgpkit-parser and requests. With support for Python 3.9 through 3.13 and an MIT license, it is suitable for both research and production use.

Use it for:

  • Query historical BGP updates from a specific time window to analyze routing changes or detect anomalies.
  • Look up the ASN, country, and organization details for an IP address to enrich network traffic logs.
  • Validate RPKI ROAs for a given prefix to check BGPSEC compliance and detect route hijacks.
  • Parse BGP community values and their meanings to understand routing policies in a network.
  • Retrieve peer information and active collectors to build a map of BGP monitoring infrastructure.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Python bindings for BGPKIT tools that parse BGP data, query MRT archives, and look up IP/ASN/ROAS information from public BGP repositories.

Yes. PyBGPKit is actively maintained, has low install friction, carries no known vulnerabilities, and offers a clean Python interface to production BGP data infrastructure. Install it if you work with BGP routing analysis, network security, or IP geolocation at scale. The MIT license and broad Python version support make it suitable for both research and commercial projects.

Install

pybgpkit on PyPI

pip

pip install pybgpkit

uv

uv add pybgpkit

poetry

poetry add pybgpkit

Installing pybgpkit

Before you install

Low friction: pure Python wheel with only two runtime dependencies (pybgpkit-parser and requests). Actively maintained with a recent release 43 days ago and continuous repository activity.

License in practice

MIT license permits commercial and private use with minimal restrictions; you may use, modify, and distribute the package freely provided you include the license notice.

Quickstart

pip install pybgpkit

import pybgpkit

# Parse BGP updates from a remote source
parser = pybgpkit.Parser(url="https://spaces.bgpkit.org/parser/update-example")
for elem in parser:
    print(elem)

# Query MRT archive
broker = pybgpkit.Broker()
items = broker.query(ts_start="2024-01-01T00:00:00Z", ts_end="2024-01-01T01:00:00Z")

Verify before relying

  • Whether pybgpkit-parser is a compiled extension or pure Python (affects cross-platform reliability).
  • Rate limits or authentication requirements for the public BGPKIT Broker and lookup services.
  • Whether offline or local data sources are supported, or if all queries require network access.

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.9)
Install friction low — pure-Python wheel
Runtime dependencies 2 — pybgpkit-parser, requests
Maintenance actively maintained — 43 days since the last release
Last repo commit
First released
Downloads 103,322/month — #12,813 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: pybgpkit-0.8.0-py3-none-any.whl

Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9

Tags

BGP data parsing pythonMRT file queryIP ASN lookupBGP route analysisBGPKIT python bindingsBGP community lookupROAS validation python
bgp-routingnetwork-analysisgeolocation

More Internet packages