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'}
...

Metadata

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 Provenance Actions
asn_info-0.4.tar.gz 4.1 kB Without provenance Details for asn_info-0.4.tar.gz

Built distribution (wheel)

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

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

Security for asn-info 0.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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