pybgpkit
BGPKIT tools Python bindings
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 pybgpkituv
uv add pybgpkitpoetry
poetry add pybgpkitInstalling 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
Tags
More Internet packages
Botocore provides low-level, data-driven access…
permissive · top 100 on PyPI
aiobotocoreProvides an async client for AWS services using…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
filelockProvides a platform-independent file locking…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
googleapis-common-protosProvides common Protocol Buffer message…
permissive · top 100 on PyPI
pybgpkit-parserParses BGP (Border Gateway Protocol) update and…
permissive · top 15,000 on PyPI
pyasnpyasn performs fast offline IP address to…
permissive · top 15,000 on PyPI
peeringdbA Python client library for querying and…
permissive · top 15,000 on PyPI
ipwhoisRetrieves and parses whois and RDAP data for…
permissive · top 15,000 on PyPI
netutilsNetutils provides a collection of utility…
permissive · top 15,000 on PyPI
ipinfoQueries the IPinfo.io API to retrieve…
permissive · top 15,000 on PyPI
whoisitQuery RDAP (Registration Data Access Protocol)…
unclear · top 15,000 on PyPI
geoip2fastGeoIP2Fast performs fast geolocation lookups…
permissive · top 15,000 on PyPI
IP2LocationLooks up geolocation data (country, region,…
permissive · top 15,000 on PyPI
ip3countryLooks up the ISO 3166-1 alpha-2 country code…
permissive · top 5,000 on PyPI