Metadata-Version: 2.1
Name: IP2Location
Version: 8.0.1
Summary: Python API for IP2Location database. It can be used to identify visitor's geographical location, i.e. country, region, city, latitude, longitude, ZIP code, time zone, connection speed, ISP, domain name, IDD country code, area code, weather station code and name, mobile carrier, elevation and usage type information.
Home-page: https://github.com/chrislim2888/IP2Location-Python
Author: IP2Location
Author-email: support@ip2location.com
License: UNKNOWN
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Description-Content-Type: text/markdown

IP2Location Python Library
==========================

This IP2Location Python library enables user to find the country, region or state, city, latitude and longitude, US 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.
It has been optimized for speed and memory utilization. Developers can use this API to easily query the information for all IP2Location binary (BIN) databases by a given IP address. It supported IPv4 and IPv6 address.

This package can be used in many types of projects such as:

 - select the geographically closest mirror
 - analyze your web server logs to determine the countries of your visitors
 - credit card fraud detection
 - software export controls
 - display native language and currency 
 - prevent password sharing and abuse of service 
 - geotargeting in advertisement


For more details, please visit:
[https://www.ip2location.com/developers/python](https://www.ip2location.com/developers/python)


Installation
============

To install this module type the following:

	pip install IP2Location


Usage
=====

```python
	import os
	import IP2Location

	database = IP2Location.IP2Location(os.path.join("data", "IPV6-COUNTRY.BIN"))

	rec = database.get_all("19.5.10.1")

	print(rec.country_short)
	print(rec.country_long)
	print(rec.region)
	print(rec.city)
	print(rec.isp)	
	print(rec.latitude)
	print(rec.longitude)			
	print(rec.domain)
	print(rec.zipcode)
	print(rec.timezone)
	print(rec.netspeed)
	print(rec.idd_code)
	print(rec.area_code)
	print(rec.weather_code)
	print(rec.weather_name)
	print(rec.mcc)
	print(rec.mnc)
	print(rec.mobile_brand)
	print(rec.elevation)
	print(rec.usage_type)
	print("\nYou may download the DB24 sample BIN at https://www.ip2location.com/downloads/sample6.bin.db24.zip for full data display.")
```


Sample BIN Databases
====================
* Download free IP2Location LITE databases at [https://lite.ip2location.com](https://lite.ip2location.com)  
* Download IP2Location sample databases at [https://www.ip2location.com/developers](https://www.ip2location.com/developers)

IPv4 BIN vs IPv6 BIN
====================
* Use the IPv4 BIN file if you just need to query IPv4 addresses.
* Use the IPv6 BIN file if you need to query BOTH IPv4 and IPv6 addresses.

Support
=======
Email: support@ip2location.com.  
URL: [https://www.ip2location.com](https://www.ip2location.com)


