Code Monkey home page Code Monkey logo

ip2location-python's Introduction

IP2Location 9.0.0

Enable Thread safe IPLocation use.

from ip2location import IP2Location

IP_LOCATION = IP2Location.IP2Location(os.path.join(os.path.dirname(os.path.realpath(__file__)), 'IP-COUNTRY.BIN'))

def get_ip(ip):
   return IP_LOCATION.get_country_short(self.ipaddress)

This is a IP2Location Python library that enables the 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.

Supported IPv4 and IPv6 address.

For more details, please visit: http://www.ip2location.com/developers/python

Requirements

  1. Python 2.2 and above

Installation

  1. Unzip the package.
  2. Execute python setup.py build
  3. Execute python setup.py install

Testing

python sample.py
python test.py

Sample BIN Databases

Support

Email: [email protected].
URL: http://www.ip2location.com

ip2location-python's People

Contributors

chrislim2888 avatar vstoykov avatar yuri1992 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.