A sandcastle built with a bulldozer.
This started out as a simple project to build a Python utility library and explore WebAPI and RESTConf. The result was an experiment into async calls using Click/AsyncClick, HTTPX, pydantic for strong typing and pytest as an intro to dependency injection and Functional Python
All API calls are provided by BGPView. For valid data, try Postman to view https://api.bgpview.io/search
(0.1.0) C:\[Projects Folder]\bgplookup-project\0.1.0>python --version
Python 3.6.10
(0.1.0) C:\[Projects Folder]\bgplookup-project\0.1.0>pip install -e ./BGPLookup-master
...
(0.1.0) C:\[Projects Folder]\bgplookup-project\0.1.0>bgplookup --help
Usage: bgplookup [OPTIONS] [DATAKEYS]...
Options:
--asn INTEGER Target host is 'https://api.bgpview.io'.
Provide details for given ASN (1-64496).
Follow with optional datakeys (space separated).
--peers Provide peer details for given ASN.
-ix, --exchange INTEGER Provide details for given Inet Exchange (1-853).
Follow with optional datakeys (space separated).
--prefix TEXT The base IP address/Length of the announced prefix.
Follow with optional datakeys (space separated).
--debug Output the raw JSON response, if received.
-v, --version Show version and exit.
--help Show this message and exit.
(0.1.0) C:\[Projects Folder]\bgplookup-project\0.1.0>bgplookup --asn 61138
This command is the equivalent to the API call: https://api.bgpview.io/asn/61138
(0.1.0) C:\[Projects Folder]\bgplookup-project\0.1.0>bgplookup --asn 61138 --peers
This command is the equivalent to the API call: https://api.bgpview.io/asn/61138/peers
(0.1.0) C:\[Projects Folder]\bgplookup-project\0.1.0>bgplookup --prefix 192.209.63.0/24 ASNS RIR_ALLOCATION IANA_ASSIGNMENT
For a bit of fun, the challenge was to isolate and display selected first-level data groups