Aspath

ASPath #

The aspath handler will return the current as-path for the IP requested.

Always check the status_code is 200 after each query.
exists will only be true if a live route exists for the queried prefix. If there is no live prefix, the HTTP status code will still be 200.
Some IPs have as-paths that contain as-sets. This is stored separately.

c = bgpstuff.Client()

c.get_as_path("185.186.206.0")
if c.status_code == 200 and c.exists:
    print(f"The as-path for 185.186.206.0 is {c.as_path}")
The as-path for 185.186.206.0 is [13030, 8529, 28885]

if c.as_set:
    print(f"The as-set for 185.186.206.0 is {c.as_set}")
The as-set for 185.186.206.0 is [206350]
TODO