Network Info
- class prsw.stat.network_info.NetworkInfo(RIPEstat, resource: ip_address)
This data call returns the containing prefix and announcing ASN of a given IP address.
Reference: ‘<https://stat.ripe.net/docs/data_api#network-info>’_
Property
Description
asnsList of ASNs the prefix is announced from
prefixIPAddress containing the prefix the requessted IP address is in
ripe = prsw.RIPEstat() response = ripe.network_info('140.78.90.50') for asn in response.asns: print(asn) # 5511 # 6453 reponse.asns # [5511, 6453] print(response.prefix) # '140.78.0.0/16' response.prefix # IPv4Network('140.78.0.0/16')
- __init__(RIPEstat, resource: ip_address)
Initialize and request Network Info.
- Parameters
resource – Any IP address one wants to get network info for
- property asns
Return a list of ASNs the prefix is announced from.
- property prefix
Return the prefix the requested IP address is in.