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.2.tar.gz
(100.5 kB
view hashes)
Built Distributions
Close
Hashes for pybgpkit_parser-0.4.2-cp311-cp311-manylinux_2_27_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 82d5ae196423412d56398e717a934984d742304a77ff3f067640f6c8e4633565 |
|
MD5 | d4c8b9752b8fe7e94836f524750d490a |
|
BLAKE2b-256 | 0bc79a3fe55529673ea73a2a98329da902bc0f346f686103f417761c7cddd53e |
Close
Hashes for pybgpkit_parser-0.4.2-cp311-cp311-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2df25e0ccc6d937661cfa74dff89df3a52654e46d751fd816b861a553d1be62d |
|
MD5 | 220e7399d88d661b1458c21f625bdb34 |
|
BLAKE2b-256 | 19bad42c475d281d972d1d0a7452af5a21e1620969806e4d0dc56cfe7fd9a98c |
Close
Hashes for pybgpkit_parser-0.4.2-cp310-cp310-manylinux_2_27_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ea8eaf6d5dffdd196fc3316c67797f0fe571782d8425c78bfd18bb103a11451 |
|
MD5 | 56ade11fab10032077e9b7520f9240bc |
|
BLAKE2b-256 | 732aeeea716aaefc5257b25bafea9b131c8aaae026578108f523e501f430d620 |
Close
Hashes for pybgpkit_parser-0.4.2-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f419eabea5269fce8d2ad51bdfa7efe622aec759e0786f52732fde9e8394565 |
|
MD5 | 59ec80ac594112e33f9d80caa73e36c3 |
|
BLAKE2b-256 | ef3f98df677c12169fea2cfb262d2d87aaaaaa2f4d406b11dbc2b82da520d2ee |
Close
Hashes for pybgpkit_parser-0.4.2-cp39-cp39-manylinux_2_27_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4de9cfd88de47500298521d2a0aa054ad0f6db1eaec8c54f9cd756e62e7ffea1 |
|
MD5 | 2af50e73e25dff3b6873d1fd0087f0d7 |
|
BLAKE2b-256 | b69627f37a6f105fc2dc918507ed2ad1327b423c1a280cb0a2047931a01cbd56 |
Close
Hashes for pybgpkit_parser-0.4.2-cp39-cp39-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8c31159efc1bb08acd9ead9f7b02b6c46df3e79d5b78f9cf0ced4ee98783b757 |
|
MD5 | 36c45c4c9bcfa35eda9007053e7ea4c0 |
|
BLAKE2b-256 | aad010a008b7b351f930e665742684bdb2014cdd7a4f6f667afc1d1e0303a817 |
Close
Hashes for pybgpkit_parser-0.4.2-cp38-cp38-manylinux_2_27_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b5cc765f9810486eaacef1d2311fde7e9e925039c32febc0ebda836eb9fd9813 |
|
MD5 | 2bc86aad22dd2d3acc888ef8842c0ca8 |
|
BLAKE2b-256 | 7bb00cc74226d9098dd5830ed7f851fc7406843cb24b6cf5ef4948bf65dab48b |
Close
Hashes for pybgpkit_parser-0.4.2-cp37-cp37m-manylinux_2_27_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 97980fad06926453a5f7ea4e8d809753b36d2a525e8180a7fdbbed6aa3bf6a7a |
|
MD5 | f17e76b35d943af7bdcfc23e0e7dc2a0 |
|
BLAKE2b-256 | 6d5da138e027c9fb38572ccc36d0e0a9b02d241bb2ec3d9afeb3be9320754b53 |