Skip to main content

ipip.net IP address geolocation database Python library

Project description

Description

ipip.net IPv4 地址归属地数据库 Python 查询库。同时支持 dat 与 datx 格式的数据文件,支持 Python 2 与 3。 需要先去 ipip.net 官方网站 下载数据文件。

性能较官方库为高,在 E5-2682 2.5GHz 下 QPS 约为 490k。

Usage

>>> from pyipip import IPIPDatabase
>>> db = IPIPDatabase('/path/to/your/ipipdb.dat')
>>> db.lookup('202.112.80.106')
'中国\t北京\t北京\t'

Install

pip install pyipip

Test & Benchmark

make test
make bench

Note

数据文件时时更新,请自行下载使用,代码仓库随附的数据文件只用于测试。

Project details


Download files

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

Source Distribution

pyipip-0.1.1.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

pyipip-0.1.1-py2.py3-none-any.whl (5.4 kB view details)

Uploaded Python 2Python 3

File details

Details for the file pyipip-0.1.1.tar.gz.

File metadata

  • Download URL: pyipip-0.1.1.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pyipip-0.1.1.tar.gz
Algorithm Hash digest
SHA256 9ec2e6c5fcaf61fe31249d28a2df80b9dd72b3dec84e8fb96c2def4449e44e04
MD5 28bc0e5cdbe9ab10a4d177c4b258b773
BLAKE2b-256 0a2bd813125809494b224da59b3020264f616d3a0c746e54fbac2f8589de19ed

See more details on using hashes here.

File details

Details for the file pyipip-0.1.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for pyipip-0.1.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 c16c01f05da3c48352518074576e26221056497d4400236846c4e4dd205e871c
MD5 104de85fe1f7bed605dd01992ee88985
BLAKE2b-256 b568f5e3868c60c377468e31391ff2312244944dc21b53280cad3a082ffd1cc8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page