Skip to main content
Join the official Python Developers Survey 2018 and win valuable prizes: Start the survey!

获取域名或者IP的所在地

Project description

python-ip

  • 基于[全球 IPv4 地址归属地数据库](http://tool.17mon.cn/ipdb.html)修改的Python版本
  • 只支持Python2
  • 支持域名查询
  • 支持IP直接查询

致谢

我自己的代码写的不好,这个风格是参考[lxyu的代码](https://github.com/lxyu/17monip)修改的,大家star他的库比较好~

安装

$ sudo pip install ip2loc

使用方法

>>> import ip2loc
>>> print ip2loc.find("www.langman1dian.com")
'日本   日本'
>>> print ip2loc.find("106.186.17.155")
'日本   日本'

协议

基于[WTFPL](http://en.wikipedia.org/wiki/WTFPL)协议开源。

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
ip2loc-0.1.3.tar.gz (281.5 kB) Copy SHA256 hash SHA256 Source None Mar 6, 2014

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page