Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 85cde11

Browse files
committedJun 3, 2021
Added supports for IP2Location DB25 database.
1 parent c759b97 commit 85cde11

7 files changed

+226
-114
lines changed
 

‎IP2Location.py

+197-89
Large diffs are not rendered by default.

‎PKG-INFO

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Metadata-Version: 1.0
22
Name: IP2Location
3-
Version: 8.5.1
3+
Version: 8.6.0
44
Summary: Python API for IP2Location database
55
Home-page: http://www.ip2location.com
66
Author: IP2Location

‎README.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# IP2Location 8.5.1
1+
# IP2Location 8.6.0
22

33

4-
This is a IP2Location Python library that enables the user to find the country, region or state, city, latitude and longitude, ZIP code, time zone, Internet Service Provider (ISP) or company name, domain name, net speed, area code, weather station code, weather station name, mobile country code (MCC), mobile network code (MNC) and carrier brand, elevation, and usage type by IP address or hostname originates from. The library reads the geo location information from **IP2Location BIN data** file.
4+
This is a IP2Location Python library that enables the user to find the country, region or state, city, latitude and longitude, ZIP code, time zone, Internet Service Provider (ISP) or company name, domain name, net speed, area code, weather station code, weather station name, mobile country code (MCC), mobile network code (MNC) and carrier brand, elevation, usage type, address type and IAB category by IP address or hostname originates from. The library reads the geo location information from **IP2Location BIN data** file.
55

66
Supported IPv4 and IPv6 address.
77

@@ -59,6 +59,8 @@ Below is the description of the functions available in the **BIN Database** look
5959
| get_mobile_brand | Commercial brand associated with the mobile carrier. Please visit [Mobile Carrier Coverage](https://www.ip2location.com/mobile-carrier-coverage) to view the coverage report. |
6060
| get_elevation | Return average height of city above sea level in meters (m). |
6161
| get_usage_type | Return the ISP's usage type of IP address. Please see [Usage Type](https://github.com/[chrislim2888/IP2Location-Python](https://github.com/chrislim2888/IP2Location-Python)#usage-type) for details. |
62+
| get_address_type | Return the IP address type (A-Anycast, B-Broadcast, M-Multicast & U-Unicast) of IP address or domain name. |
63+
| get_category | Return the IAB content taxonomy category of IP address or domain name. You can get a full list of IAB content taxonomy category from [here](https://www.ip2location.com/free/iab-categories). |
6264

6365
## Web Service
6466

‎data/IP2LOCATION-LITE-DB1.BIN

194 KB
Binary file not shown.

‎data/IP2LOCATION-LITE-DB1.IPV6.BIN

309 KB
Binary file not shown.

‎sample.py

+22-20
Original file line numberDiff line numberDiff line change
@@ -18,26 +18,28 @@
1818

1919
rec = database.get_all("19.5.10.1")
2020

21-
print(rec.country_short)
22-
print(rec.country_long)
23-
print(rec.region)
24-
print(rec.city)
25-
print(rec.isp)
26-
print(rec.latitude)
27-
print(rec.longitude)
28-
print(rec.domain)
29-
print(rec.zipcode)
30-
print(rec.timezone)
31-
print(rec.netspeed)
32-
print(rec.idd_code)
33-
print(rec.area_code)
34-
print(rec.weather_code)
35-
print(rec.weather_name)
36-
print(rec.mcc)
37-
print(rec.mnc)
38-
print(rec.mobile_brand)
39-
print(rec.elevation)
40-
print(rec.usage_type)
21+
print("Country Code : " + rec.country_short)
22+
print("Country Name : " + rec.country_long)
23+
print("Region Name : " + rec.region)
24+
print("City Name : " + rec.city)
25+
print("ISP Name : " + rec.isp)
26+
print("Latitude : " + rec.latitude)
27+
print("Longitude : " + rec.longitude)
28+
print("Domain Name : " + rec.domain)
29+
print("ZIP Code : " + rec.zipcode)
30+
print("Time Zone : " + rec.timezone)
31+
print("Net Speed : " + rec.netspeed)
32+
print("Area Code : " + rec.idd_code)
33+
print("IDD Code : " + rec.area_code)
34+
print("Weather Station Code : " + rec.weather_code)
35+
print("Weather Station Name : " + rec.weather_name)
36+
print("MCC : " + rec.mcc)
37+
print("MNC : " + rec.mnc)
38+
print("Mobile Carrier : " + rec.mobile_brand)
39+
print("Elevation : " + rec.elevation)
40+
print("Usage Type : " + rec.usage_type)
41+
print("Address Type : " + rec.address_type)
42+
print("Category : " + rec.category)
4143
print("\nYou may download the DB24 sample BIN at http://www.ip2location.com/downloads/sample6.bin.db24.zip for full data display.")
4244

4345
# Web Service

‎setup.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55

66
setuptools.setup(
77
name="IP2Location",
8-
version="8.5.1",
8+
version="8.6.0",
99
author="IP2Location",
1010
author_email="support@ip2location.com",
11-
description="Python API for IP2Location database.",
11+
description="This is an IP geolocation library that enables the user to find the country, region, city, latitude and longitude, ZIP code, time zone, ISP, domain name, area code, weather info, mobile info, elevation, usage type, address type and IAB category from an IP address. It supports both IPv4 and IPv6 lookup.",
1212
long_description=long_description,
1313
long_description_content_type="text/markdown",
1414
py_modules=['IP2Location'],

0 commit comments

Comments
 (0)