Skip to main content

PyBGPKIT

Python bindings for BGPKIT software. For all software offerings, please check out our GitHub repository at https://github.com/bgpkit.

SDKs

BGPKIT Parser

See the bgpkit-parser-py documentation for the full API.

import bgpkit

# Full element parsing
parser = bgpkit.Parser(url="https://spaces.bgpkit.org/parser/update-example",
                       filters={"peer_ips": "185.1.8.65, 2001:7f8:73:0:3:fa4:0:1"})
for elem in parser:
    print(elem)

# Route-level parsing (faster, fewer fields)
for route in bgpkit.RouteParser(url="https://spaces.bgpkit.org/parser/update-example"):
    print(route.prefix, route.as_path)

# Reusable filter objects
from bgpkit import Filter
f = Filter.peer_ip("185.1.8.65")
parser = bgpkit.Parser.from_filters(url, [f])

BGPKIT Broker

import bgpkit
broker = bgpkit.Broker()

# Search MRT data files
items = broker.query(ts_start="2024-01-01T00:00:00Z", ts_end="2024-01-01T01:00:00Z")
print(len(items))

# Get latest files
latest = broker.latest()

# Query peer information
peers = broker.peers(asn=13335, full_feed=True)

# List collectors
collectors = broker.collectors(project="routeviews", active=True)

BGPKIT IP Lookup

ip_info = bgpkit.IpLookup().query("1.1.1.1")
print(ip_info.country, ip_info.as_number, ip_info.as_name)

BGPKIT ASN Lookup

result = bgpkit.AsnLookup().query(asn="13335", country="US")
for asn in result.data:
    print(asn.asn, asn.name, asn.country)

BGPKIT Community Lookup

entries = bgpkit.CommunityLookup().query(asn="13335", page_size=50)
for entry in entries:
    print(entry.value, entry.description)

sources = bgpkit.CommunityLookup().sources()

BGPKIT ROAS Lookup

BGPKIT ROAS Lookup

roas = bgpkit.Roas()
data = roas.query(asn=3333, date="2018-01-01")
for entry in data:
    print(entry.prefix, entry.asn, entry.tal)

# Current ROAs only
current = roas.query(prefix="1.1.1.0/24", current=True)

Build and Publish

Push a version tag to build and publish automatically via GitHub Actions:

git tag v0.7.0
git push origin v0.7.0

Manual release:

python -m pip install --upgrade build twine
python -m build
twine upload --skip-existing dist/*

PyPI Trusted Publishing is configured for automated releases. See .github/workflows/release.yml.

Metadata

Release files for pybgpkit 0.10.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pybgpkit 0.10.0
File Size Uploaded Provenance Actions
pybgpkit-0.10.0.tar.gz 13.6 kB With provenance Details for pybgpkit-0.10.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pybgpkit 0.10.0
File Interpreter ABI Platform Actions
pybgpkit-0.10.0-py3-none-any.whl Python 3 none any Details for pybgpkit-0.10.0-py3-none-any.whl

Total release size: 24.1 kB

Release files / pybgpkit-0.10.0.tar.gz

Download URL pybgpkit-0.10.0.tar.gz
Size 13.6 kB
Tags Source
SHA-256 checksum
How to use checksums
cf560b87a07cf709de15830c259c0b0c36ab0b3498fd83345937208370ab45ee
BLAKE2b-256 checksum
How to use checksums
be0a2e1bd7fbe6aa3674caa8b39c2b863ae81e33eba94d6a68c4f19664dbdcbb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.

Transparency log

Release files / pybgpkit-0.10.0-py3-none-any.whl

Download URL pybgpkit-0.10.0-py3-none-any.whl
Size 10.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
69683d09fd46939153e15618f39294cde11a300813a2fb0f1d9914f93e8c8973
BLAKE2b-256 checksum
How to use checksums
96be8873b1ed5db093283a16a7e9493a7ac3eb79dd8d3ae200828aefc7f75673
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.

Transparency log

Security for pybgpkit 0.10.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pybgpkit-0.10.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page