Skip to main content

A python class to quickly search ip2asn data for range matches

Project description

Objective

A python class to search ip2asn information for matches.

Installation

Using pip:

pip3 install ip2asn

Or manually:

git clone git@github.com:hardaker/ip2asn.git
cd ip2asn
python3 setup.py build
python3 setup.py install

Example Usage

setup

curl -o ip2asn-v4-u32.tsv.gz https://iptoasn.com/data/ip2asn-v4-u32.tsv.gz
gunzip ip2asn-v4-u32.tsv.gz

Coding

import ip2asn
i2a = ip2asn.IP2ASN("ip2asn-v4-u32.tsv")
result = i2a.lookup_address("93.184.216.34")

import pprint
pprint.pprint(result)

Produces:

{'ASN': '15133',
 'country': 'US',
 'ip_numeric': 1572395042,
 'ip_range': [1572394752, 1572396543],
 'ip_text': '93.184.216.34',
 'owner': 'EDGECAST - MCI Communications Services, Inc. d/b/a Verizon Business'}

Author

Wes Hardaker, USC/ISI

Project details


Download files

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

Source Distribution

ip2asn-1.1.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

ip2asn-1.1-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file ip2asn-1.1.tar.gz.

File metadata

  • Download URL: ip2asn-1.1.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.2 pkginfo/1.4.2 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.7

File hashes

Hashes for ip2asn-1.1.tar.gz
Algorithm Hash digest
SHA256 111ddee4e404d785d44d58da773634a65bfafbc47e36e37e1ac111be89f46e34
MD5 5d0da183113fa29816a2caec9574b1fa
BLAKE2b-256 ef00b000cb7b718a2f1ee579122cf0bdc7e4a3061bbba9e7ef19b7404e75a78b

See more details on using hashes here.

File details

Details for the file ip2asn-1.1-py3-none-any.whl.

File metadata

  • Download URL: ip2asn-1.1-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.2 pkginfo/1.4.2 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.7

File hashes

Hashes for ip2asn-1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 50cf5eab9962abb9b5d8848db865b51266139ea06bb59116fdeb9ae97ff194bd
MD5 328afb58c67ae311287c0bda98265754
BLAKE2b-256 9ade9be815b61ce09de06a3c483b9b88e7156291e7a2cc0df0a18b668700456c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page