Skip to main content

ASN Info

A python library providing information about ASNs (AS Name, Country and MANRS membership)

This library downloads the Autonomous System list and information from RIPE NCC and provides its contents as objects.

There are three data points:

  • Autonomous System Name: get_as_name()
  • Autonomous System Country: get_as_country()
  • Wether an ASN is a MANRS Participant: is_manrs_participant()

MANRS Data is not loaded by default, since it requires an API key. In case you want to load it, you will have to prepare a .env file containing a line like this:

MANRS_API_KEY=ad83444d-4c68-4727-9ff6-ce2df6649c05

You can obtain an API key here

Example use:

import asn_info

asn_data = asn_info.Asns()

h = asn_data.load_asn_data(add_manrs_data=True)

print(asn_data.get_as_name(58280))
print(asn_data.get_as_country(58280))
print(asn_data.is_manrs_participant(58280))

Result:

STUCCHIMAX-AS Massimiliano Andrea Stucchi
CH
False

You can also filter the ASNs per country, as follows:

switzerland = asn_data.asns_per_country("CH")

for asn in switzerland:
    print("{} has {}".format(asn, switzerland[asn]))

Output:

...
58280 has {'country': 'CH', 'as_name': 'STUCCHIMAX-AS Massimiliano Andrea Stucchi'}
...

Release files for asn-info 0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for asn-info 0.4
File Size Uploaded
asn_info-0.4.tar.gz 4.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for asn-info 0.4
File Interpreter ABI Platform
asn_info-0.4-py3-none-any.whl Python 3 none any Details

Total release size: 8.1 kB

Release files / asn_info-0.4.tar.gz

Download URL asn_info-0.4.tar.gz
Size 4.1 kB
Tags Source
SHA-256 checksum
How to use checksums
866ccd2349e4db39515caa5a3b9775789ff353741b92bbac7b42f3ad3b94d1e2
BLAKE2b-256 checksum
How to use checksums
b48ee52d2d47b10cebd2f89f40a5bf083ba7e09c9a1d1cd5501bbde178857e6b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.7

Release files / asn_info-0.4-py3-none-any.whl

Download URL asn_info-0.4-py3-none-any.whl
Size 4.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c5bb5bb1b26c064940972fed9ed59e9d45a769fc829ac6ce59a9ef7546550853
BLAKE2b-256 checksum
How to use checksums
2234a7da82fb86e9dcd14182f9bd23727dfb2d1b83de4542c067eaec24b36d18
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.7

Release history Release notifications | RSS feed

This release

0.4 This release

2 release files

0.3

2 release files

0.2

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page