Name | asn-check JSON |
Version |
1.1.0
JSON |
| download |
home_page | None |
Summary | Check ASNs and metadata for a list of IPs |
upload_time | 2024-02-06 15:22:46 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.7 |
license | None |
keywords |
asn-lookup
click
ipv4
ripe
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
ASN Check
=========
[![PyPI version](https://badge.fury.io/py/asn-check.svg)](https://badge.fury.io/py/asn-check)
[![Python](https://img.shields.io/pypi/pyversions/asn_check)](https://img.shields.io/pypi/pyversions/asn_check)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Hatch project](https://img.shields.io/badge/%F0%9F%A5%9A-Hatch-4051b5.svg)](https://github.com/pypa/hatch)
Given a list of IPs the tool returns their AS numbers and names.
Data sources:
- [ASN ranges IPv4- Thyme APNIC](https://thyme.apnic.net/current/data-raw-table),
- [ASN ranges IPv6- Thyme APNIC](https://thyme.apnic.net/current/ipv6-raw-table),
- [AS names - ripe.net](https://ftp.ripe.net/ripe/asnames/asn.txt).
Features:
- Caching the data from sources - first run may take a long time,
- Binary IP network search for high throughput,
- Returns AS Number, AS Name and a country code for each IP address.
- Supports both IPv4 and IPv6
- Also available as a lib!
Installation
------------
pip install asn-check
Options
-------
--input-file FILENAME Input file with one IPv4 per line [default:STDIN]
--output-file FILENAME Output file - csv, header: ip,asn,name,country_code [default: STDOUT]
--log-level [DEBUG|INFO|WARNING|ERROR|CRITICAL] Set logging level. [default: WARNING]
--help Show this message and exit.
Example CLI
-----------
$ echo '250.254.147.119
12.154.0.67
41.13.122.240
176.218.30.1078
128.105.177.84
85.227.158.196
74.74.207.74
2a03:2880:f077::1' | asn-check
Output:
ip,asn,name,country_code
250.254.147.119,,,
12.154.0.67,7018,ATT-INTERNET4,US
41.13.122.240,29975,VODACOM-,ZA
128.105.177.84,59,WISC-MADISON-AS,US
85.227.158.196,2119,TELENOR-NEXTEL Telenor Norge AS,NO
74.74.207.74,11351,TWC-11351-NORTHEAST,US
2a03:2880:f077::1,32934,FACEBOOK,US
Example Lib Usage
-----------------
from ipaddress import ip_address
from asn_check import ASNChecker
checker = ASNChecker()
print(checker.search(ip_address("12.154.0.67")))
Output:
{'ip': IPv4Address('12.154.0.67'), 'asn': '7018', 'name': 'ATT-INTERNET4', 'country_code': 'US'}
Note: If you'd like to use your own data sources, theoretically you can, but they need to follow the same format as the APNIC sources (and the format is not consistent!) - check out the constructor options `asn_routes_url_v4, asn_routes_url_v6, asn_names_url`. I'd recommend sticking to the defaults.
Raw data
{
"_id": null,
"home_page": null,
"name": "asn-check",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": "asn-lookup,click,ipv4,ripe",
"author": null,
"author_email": "Miloslav Homer <miloslav.homer@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/81/ac/1df0017b6123e7cd40d8df3327c81ff4ea7a190e52760178162511cfab35/asn_check-1.1.0.tar.gz",
"platform": null,
"description": "ASN Check\n=========\n\n[![PyPI version](https://badge.fury.io/py/asn-check.svg)](https://badge.fury.io/py/asn-check)\n[![Python](https://img.shields.io/pypi/pyversions/asn_check)](https://img.shields.io/pypi/pyversions/asn_check)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n[![Hatch project](https://img.shields.io/badge/%F0%9F%A5%9A-Hatch-4051b5.svg)](https://github.com/pypa/hatch)\n\nGiven a list of IPs the tool returns their AS numbers and names.\n\nData sources:\n\n - [ASN ranges IPv4- Thyme APNIC](https://thyme.apnic.net/current/data-raw-table),\n - [ASN ranges IPv6- Thyme APNIC](https://thyme.apnic.net/current/ipv6-raw-table),\n - [AS names - ripe.net](https://ftp.ripe.net/ripe/asnames/asn.txt).\n\nFeatures:\n\n - Caching the data from sources - first run may take a long time,\n - Binary IP network search for high throughput,\n - Returns AS Number, AS Name and a country code for each IP address.\n - Supports both IPv4 and IPv6\n - Also available as a lib!\n\n\nInstallation\n------------\n\n pip install asn-check\n\n\nOptions\n-------\n\n --input-file FILENAME Input file with one IPv4 per line [default:STDIN]\n --output-file FILENAME Output file - csv, header: ip,asn,name,country_code [default: STDOUT]\n --log-level [DEBUG|INFO|WARNING|ERROR|CRITICAL] Set logging level. [default: WARNING]\n --help Show this message and exit.\n\n\nExample CLI\n-----------\n\n $ echo '250.254.147.119\n 12.154.0.67\n 41.13.122.240\n 176.218.30.1078\n 128.105.177.84\n 85.227.158.196\n 74.74.207.74\n 2a03:2880:f077::1' | asn-check \n\nOutput:\n\n ip,asn,name,country_code\n 250.254.147.119,,,\n 12.154.0.67,7018,ATT-INTERNET4,US\n 41.13.122.240,29975,VODACOM-,ZA\n 128.105.177.84,59,WISC-MADISON-AS,US\n 85.227.158.196,2119,TELENOR-NEXTEL Telenor Norge AS,NO\n 74.74.207.74,11351,TWC-11351-NORTHEAST,US\n 2a03:2880:f077::1,32934,FACEBOOK,US\n \n\nExample Lib Usage\n-----------------\n\n from ipaddress import ip_address\n from asn_check import ASNChecker\n \n checker = ASNChecker() \n print(checker.search(ip_address(\"12.154.0.67\")))\n\nOutput:\n\n {'ip': IPv4Address('12.154.0.67'), 'asn': '7018', 'name': 'ATT-INTERNET4', 'country_code': 'US'}\n\nNote: If you'd like to use your own data sources, theoretically you can, but they need to follow the same format as the APNIC sources (and the format is not consistent!) - check out the constructor options `asn_routes_url_v4, asn_routes_url_v6, asn_names_url`. I'd recommend sticking to the defaults.\n",
"bugtrack_url": null,
"license": null,
"summary": "Check ASNs and metadata for a list of IPs",
"version": "1.1.0",
"project_urls": {
"Documentation": "https://github.com/ArcHound/asn-check#readme",
"Issues": "https://github.com/ArcHound/asn-check/issues",
"Source": "https://github.com/ArcHound/asn-check"
},
"split_keywords": [
"asn-lookup",
"click",
"ipv4",
"ripe"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "aa4d5dff8d784060890e66f629433e6e401021f037454384a8fbbc22f087efe3",
"md5": "187300c2eda34d893321d8f5018af577",
"sha256": "6c1096292f17c784586e93acc4d968884adcb2c3a476a889fd14c7d84523c085"
},
"downloads": -1,
"filename": "asn_check-1.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "187300c2eda34d893321d8f5018af577",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 19448,
"upload_time": "2024-02-06T15:22:48",
"upload_time_iso_8601": "2024-02-06T15:22:48.185354Z",
"url": "https://files.pythonhosted.org/packages/aa/4d/5dff8d784060890e66f629433e6e401021f037454384a8fbbc22f087efe3/asn_check-1.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "81ac1df0017b6123e7cd40d8df3327c81ff4ea7a190e52760178162511cfab35",
"md5": "88436a0a0340346882aa2ee66be296f0",
"sha256": "0fce4e5fe3e0a43994c866678722b292c6cc8fe859de1aa975a70bd6985d337c"
},
"downloads": -1,
"filename": "asn_check-1.1.0.tar.gz",
"has_sig": false,
"md5_digest": "88436a0a0340346882aa2ee66be296f0",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 21966,
"upload_time": "2024-02-06T15:22:46",
"upload_time_iso_8601": "2024-02-06T15:22:46.107137Z",
"url": "https://files.pythonhosted.org/packages/81/ac/1df0017b6123e7cd40d8df3327c81ff4ea7a190e52760178162511cfab35/asn_check-1.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-02-06 15:22:46",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "ArcHound",
"github_project": "asn-check#readme",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "asn-check"
}