Skip to content

Commit 78a66f9

Browse files
committed
Added support for district, ASN and AS
1 parent 7024f1d commit 78a66f9

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

LICENSE.TXT

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2022 IP2Location.com
3+
Copyright (c) 2023 IP2Location.com
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

ip2trace.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
ICMP_V6_ECHO_REPLY = 129
1919
ICMP_TIME_EXCEEDED = 11
2020

21-
ip2location_result_fields = ['country_short', 'country_long', 'region', 'city', 'isp', 'latitude', 'longitude', 'domain', 'zipcode', 'timezone', 'netspeed', 'idd_code', 'area_code', 'weather_code', 'weather_name', 'mcc', 'mnc', 'mobile_brand', 'elevation', 'usage_type', 'address_type', 'category', ]
22-
ip2location_outputs_reference = ['country_code', 'country_name', 'region_name', 'city_name', 'isp', 'latitude', 'longitude', 'domain', 'zip_code', 'time_zone', 'net_speed', 'idd_code', 'area_code', 'weather_station_code', 'weather_station_name', 'mcc', 'mnc', 'mobile_brand', 'elevation', 'usage_type', 'address_type', 'category', ]
21+
ip2location_result_fields = ['country_short', 'country_long', 'region', 'city', 'isp', 'latitude', 'longitude', 'domain', 'zipcode', 'timezone', 'netspeed', 'idd_code', 'area_code', 'weather_code', 'weather_name', 'mcc', 'mnc', 'mobile_brand', 'elevation', 'usage_type', 'address_type', 'category', 'district', 'asn', 'as_name', ]
22+
ip2location_outputs_reference = ['country_code', 'country_name', 'region_name', 'city_name', 'isp', 'latitude', 'longitude', 'domain', 'zip_code', 'time_zone', 'net_speed', 'idd_code', 'area_code', 'weather_station_code', 'weather_station_name', 'mcc', 'mnc', 'mobile_brand', 'elevation', 'usage_type', 'address_type', 'category', 'district', 'asn', 'as_name', ]
2323

2424
if platform.system() == 'Windows':
2525
# Windows IPv6 compatibility
@@ -138,7 +138,7 @@ def print_usage():
138138
"\n"
139139
" -o, --output\n"
140140
" Set the desired IP2Location BIN database columns to output with.\n"
141-
" Available columns are: country_code, country_name, region_name, city_name, isp, latitude, longitude, domain, zip_code, time_zone, net_speed, idd_code, area_code, weather_station_code, weather_station_name, mcc, mnc, mobile_brand, elevation, usage_type, address_type, category.\n"
141+
" Available columns are: country_code, country_name, region_name, city_name, isp, latitude, longitude, domain, zip_code, time_zone, net_speed, idd_code, area_code, weather_station_code, weather_station_name, mcc, mnc, mobile_brand, elevation, usage_type, address_type, category, district, asn, as_name.\n"
142142
"\n"
143143
" -a, --all\n"
144144
"Print all the column(s) available based on the BIN file used.\n"
@@ -151,8 +151,8 @@ def print_usage():
151151

152152
def print_version():
153153
print(
154-
"IP2Location Geolocation Traceroute (ip2trace) Version 3.1.3\n"
155-
"Copyright (c) 2022 IP2Location.com [MIT License]\n"
154+
"IP2Location Geolocation Traceroute (ip2trace) Version 3.2.0\n"
155+
"Copyright (c) 2023 IP2Location.com [MIT License]\n"
156156
"https://www.ip2location.com/free/traceroute-application\n")
157157

158158
def traceroute(destination_server, database, ttl, output, all):
@@ -224,11 +224,11 @@ def __init__(self, destination_server, database, max_hops, output, all):
224224
if (self.output is not None):
225225
for i in self.output:
226226
if i not in ip2location_outputs_reference:
227-
print("The column name is invalid. Please get a list of valid column names at https://ip2location.com/database/db24-ip-country-region-city-latitude-longitude-zipcode-timezone-isp-domain-netspeed-areacode-weather-mobile-elevation-usagetype.")
227+
print("The column name is invalid. Please get a list of valid column names at https://www.ip2location.com/database/db26-ip-country-region-city-latitude-longitude-zipcode-timezone-isp-domain-netspeed-areacode-weather-mobile-elevation-usagetype-addresstype-category-district-asn.")
228228
sys.exit()
229229

230230
def print_start(self):
231-
print("IP2Location Geolocation Traceroute (ip2trace) Version 3.1.3\n"
231+
print("IP2Location Geolocation Traceroute (ip2trace) Version 3.2.0\n"
232232
"Copyright (c) 2022 IP2Location.com [MIT License]\n"
233233
"https://www.ip2location.com/free/traceroute-application\n\n")
234234
if self.destination_domain_name is not None:

readme.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# IP2Trace Python
22

3-
IP2Trace Python is a Python tool allowing user to get IP address information such as country, region, city, latitude, longitude, zip code, time zone, ISP, domain name, connection type, area code, weather, mobile network, elevation, usage type from traceroute probes IP address.
3+
IP2Trace Python is a Python tool allowing user to get IP address information such as country, region, city, latitude, longitude, zip code, time zone, ISP, domain name, connection type, area code, weather, mobile network, elevation, usage type, address type, IAB category, district, autonomous system number (ASN) and autonomous system (AS) from traceroute probes IP address.
44

55
*Note: This tool requires Python 2.7, or Python 3.5 or later.*
66

@@ -29,7 +29,7 @@ Usage: ip2tracepy -p [IP ADDRESS/HOSTNAME] -d [IP2LOCATION BIN DATA PATH] [OPTIO
2929
3030
-o, --output
3131
Set the desired IP2Location BIN database columns to output with.
32-
Available columns are: country_code, country_name, region_name, city_name, isp, latitude, longitude, domain, zip_code, time_zone, net_speed, idd_code, area_code, weather_station_code, weather_station_name, mcc, mnc, mobile_brand, elevation, usage_type, address_type, category.
32+
Available columns are: country_code, country_name, region_name, city_name, isp, latitude, longitude, domain, zip_code, time_zone, net_speed, idd_code, area_code, weather_station_code, weather_station_name, mcc, mnc, mobile_brand, elevation, usage_type, address_type, category, district, asn, as_name.
3333
3434
-a, --all
3535
Print all the column(s) available based on the BIN file used.
@@ -52,8 +52,8 @@ ip2tracepy 8.8.8.8 -d /usr/local/share/ip2location/DB3.BIN -a
5252
Example output:
5353

5454
```bash
55-
IP2Location Geolocation Traceroute (ip2trace) Version 3.1.3
56-
Copyright (c) 2021 IP2Location.com [MIT License]
55+
IP2Location Geolocation Traceroute (ip2trace) Version 3.2.0
56+
Copyright (c) 2023 IP2Location.com [MIT License]
5757
https://www.ip2location.com/free/traceroute-application
5858

5959
Traceroute to dns.google ( 8.8.8.8 )
@@ -78,8 +78,8 @@ ip2tracepy google.com -d /usr/local/share/ip2location/DB3.BIN -a
7878
Example output:
7979

8080
```bash
81-
IP2Location Geolocation Traceroute (ip2trace) Version 3.1.3
82-
Copyright (c) 2021 IP2Location.com [MIT License]
81+
IP2Location Geolocation Traceroute (ip2trace) Version 3.2.0
82+
Copyright (c) 2023 IP2Location.com [MIT License]
8383
https://www.ip2location.com/free/traceroute-application
8484

8585
Traceroute to dns.google ( 8.8.8.8 )

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
setuptools.setup(
88
name="IP2Trace",
9-
version="3.1.3",
9+
version="3.2.0",
1010
description="A Python tool to display geolocation information in the traceroute.",
1111
long_description_content_type="text/markdown",
1212
long_description=long_description,

0 commit comments

Comments
 (0)