BGPKIT Parser Python Binding
Project description
bgpkit-parser-py
Python binding for bgpkit-parser
Example
from pybgpkit_parser import Parser
import json
parser = 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["origin_asns"])
print(json.dumps(elem, indent=4))
break
You can also add cache_dir
to Parser to cache the downloaded files to a specified directory.
Here is an example:
from pybgpkit_parser import Parser
import json
parser = Parser(
url="https://spaces.bgpkit.org/parser/update-example",
filters={"peer_ips": "185.1.8.65, 2001:7f8:73:0:3:fa4:0:1"},
cache_dir="./"
)
for elem in parser:
print(elem["origin_asns"])
print(json.dumps(elem, indent=4))
break
Supported Python Version
- Python3.7
- Python3.8
- Python3.9
- Python3.10
- Python3.11
Installation
python3 -m pip install pybgpkit-parser
Develop
maturin develop
builds local python module and add to the venv.
Publish for Linux
Install multiple Python interpreters:
sudo apt install software-properties-common
sudo add-apt-repository ppa:deadsnakes/ppa
Build and upload for multiple interpreter versions:
maturin publish --interpreter python3.7 --skip-existing
maturin publish --interpreter python3.8 --skip-existing
maturin publish --interpreter python3.9 --skip-existing
maturin publish --interpreter python3.10 --skip-existing
maturin publish --interpreter python3.11 --skip-existing
Using docker
docker build -t bgpkit-builder:latest .
docker run --rm -it bgpkit-builder:latest bash
####
# TODO: copy the content of .pypirc to the root folder
####
git clone https://github.com/bgpkit/bgpkit-parser.git
cd bgpkit-parser/bgpkit-parser-py
maturin publish --interpreter python3.7 --skip-existing
maturin publish --interpreter python3.8 --skip-existing
maturin publish --interpreter python3.9 --skip-existing
maturin publish --interpreter python3.10 --skip-existing
maturin publish --interpreter python3.11 --skip-existing
Publish for MacOS
maturin publish --skip-existing
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pybgpkit_parser-0.4.3.tar.gz
(14.5 kB
view hashes)
Built Distributions
Close
Hashes for pybgpkit_parser-0.4.3-cp311-cp311-manylinux_2_27_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5deccefbb1a4e2514d29c49b9b3415ace082f850e01f4fc17e254b3041e0399e |
|
MD5 | 8d0039a4e796cd16bd90a1ef3d890272 |
|
BLAKE2b-256 | f1c92c8fb87c263b35da10b6fe81bc38adc3d1afeb254fe46db4c6933b6f8158 |
Close
Hashes for pybgpkit_parser-0.4.3-cp311-cp311-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3de38e45be0206902ecaf213acb3fb3ded09ac06660aa561b50160b4dcd13ae3 |
|
MD5 | 248798ecff03216b5e45d7343a5795f0 |
|
BLAKE2b-256 | d0037146977232cd3fee8fc7612417157b4e6fe863cca04659fb85e8d2d581a7 |
Close
Hashes for pybgpkit_parser-0.4.3-cp310-cp310-manylinux_2_27_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b62c1dc777d9445aae9c0e12da97ace397b52fb15b3599393475ec681175ac97 |
|
MD5 | 2371f25f405a1af18ff8a3d8a63589e2 |
|
BLAKE2b-256 | 7ef24ccdbf268bd6e1df5a0a2d8b91c33e3ce64917fe5025136444367a28dc69 |
Close
Hashes for pybgpkit_parser-0.4.3-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d96a3dd044c92862a33281d4bf031abb8ce61bf48abd1833a283c50b4ceabb6b |
|
MD5 | df557fe6b50c522ca3773310d8175f69 |
|
BLAKE2b-256 | a228ff11af1fbd9e196e08ba7e94a7af02b83ea49c19b4640556c853d38f018d |
Close
Hashes for pybgpkit_parser-0.4.3-cp39-cp39-manylinux_2_27_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e052df6a62103e13e47a884f00dbf9d57b5a40751549919fe31073705379cb4 |
|
MD5 | e911deda54f5874f6ea8f5d982f73ff9 |
|
BLAKE2b-256 | bfa6bc79fbf29480d794a0e7e4148bc9714cfbfe6c8d2273133ac82326a011bd |
Close
Hashes for pybgpkit_parser-0.4.3-cp39-cp39-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 37abf6b10bf7e42d21c766661d1a593d119dc5426bc71623b1a4e693f13a8511 |
|
MD5 | 534ba2572cbd99eea686b7ca0d4cefed |
|
BLAKE2b-256 | f1c691aeb0233bbac33b4295c816a438fbdf985e898a861e5f2c91bec8939715 |
Close
Hashes for pybgpkit_parser-0.4.3-cp38-cp38-manylinux_2_27_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 39d093e4b89cc541c823e0cfc0464f1714dcb38bc30294ba5ce0f5c3e42f7007 |
|
MD5 | d74432d2cf5758bad5e70ab0df4cff61 |
|
BLAKE2b-256 | 978ffb98a469d39e3365b55dd6023c7d90b20ea319d583873ad8395dfafe2e8c |
Close
Hashes for pybgpkit_parser-0.4.3-cp38-cp38-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c05ca810dc8278c6db6b1a48f195c57772d40fa1f8d131b2e142ab61ad2ebc3e |
|
MD5 | 792c10e61149ce3adf2d8b86ac21c8bf |
|
BLAKE2b-256 | efd4706d3ef8f65091f7b4ea5fa3faffe3a5337a28e46112e7db99b35f7a990d |
Close
Hashes for pybgpkit_parser-0.4.3-cp37-cp37m-manylinux_2_27_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c3155e2fbab9b64fab0967b959d1ad1cb3d44fe5b1afd640bb985f70ce32cbb4 |
|
MD5 | 681889ffc3b4a3752b4d86650f40cadc |
|
BLAKE2b-256 | 616e2066d6afa80f358a66bc7378cb4c81aadb1e3376188070c9675ca50e979d |