Skip to main content

Democritus Asns

PyPI CI Lint codecov The Democritus Project uses semver version 2.0.0 The Democritus Project uses black to format code License: LGPL v3

Democritus functions[1] for working with asns.

[1] Democritus functions are simple, effective, modular, well-tested, and well-documented Python functions.

We use d8s as an abbreviation for democritus (you can read more about this here).

Functions

  • def asn_standardize(as_number: str) -> Optional[str]:
        """Standardize the ASN format."""
    
  • def standardize_asn_decorator(func):
        """Standardize the first argument as an ASN."""
    
  • def asn_announced_prefixes(as_number: str) -> Iterable[str]:
        """."""
    
  • def asn_adjacent_asns(as_number: str) -> Iterable[str]:
        """."""
    
  • def asns_find(text: str) -> Iterable[str]:
        """Parse ASNs from the given text."""
    
  • def asns() -> Iterable[Tuple[str, str]]:
        """Get a list of ASNs from http://bgp.potaroo.net/as1221/asnames.txt."""
    
  • def asn_number(as_number: str) -> int:
        """Get the number value of the given ASN."""
    
  • def asn_is_private(as_number: str) -> bool:
        """Check if the given ASN is private."""
    
  • def asns_private_numbers() -> Iterable[int]:
        """Return the reserved (private) ASN numbers.
    
    Data is collected from:
    
    https://www.iana.org/assignments/iana-as-numbers-special-registry/iana-as-numbers-special-registry.xhtml
    
    This function only returns the private ASN numbers.
    The `asns_private_ranges` function returns more information about the private ASN ranges."""
    
  • def asns_private_ranges() -> List[Dict[str, str]]:
        """Return the reserved (private) ASN ranges.
    
    Data is collected from:
    
    https://www.iana.org/assignments/iana-as-numbers-special-registry/iana-as-numbers-special-registry.xhtml"""
    
  • def asn_name(as_number: str) -> Optional[str]:
        """Get the name of the given asn."""
    

Development

👋  If you want to get involved in this project, we have some short, helpful guides below:

If you have any questions or there is anything we did not cover, please raise an issue and we'll be happy to help.

Credits

This package was created with Cookiecutter and Floyd Hightower's Python project template.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

d8s_asns-0.6.2.tar.gz (26.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

d8s_asns-0.6.2-py2.py3-none-any.whl (22.5 kB view details)

Uploaded Python 2Python 3

File details

Details for the file d8s_asns-0.6.2.tar.gz.

File metadata

  • Download URL: d8s_asns-0.6.2.tar.gz
  • Upload date:
  • Size: 26.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

File hashes

Hashes for d8s_asns-0.6.2.tar.gz
Algorithm Hash digest
SHA256 da307bb05b72ced636635ef3b526d666cdd79315f72cd209689f8da7ad0e0695
MD5 14ee847b2f0dd869b24da316f880ad3f
BLAKE2b-256 4cb09b746dc01f3c7781a6f7912d519fe3370f547638cb0b2dd29205aee4397f

See more details on using hashes here.

File details

Details for the file d8s_asns-0.6.2-py2.py3-none-any.whl.

File metadata

  • Download URL: d8s_asns-0.6.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 22.5 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

File hashes

Hashes for d8s_asns-0.6.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 505f51a4c07786c970fc4e00e847b744218b49ad137a32a5855acae5309354b3
MD5 d1b90e2eb87f50c7e7c811f32cfbda62
BLAKE2b-256 1d8bc088ca48b1bad1fb4f8dd50085ea016d30ab7a6c6cc7fba2095825aff14a

See more details on using hashes here.

Release history Release notifications | RSS feed

0.8.0

2 files

0.7.0

2 files

This release

0.6.2 This release

2 files

0.6.1

2 files

0.6.0

2 files

0.5.0

2 files

0.4.0

2 files

0.3.0

2 files

0.2.0

2 files

0.1.0

2 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