Skip to main content

PyIPIP

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

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

Metadata

Release files for pyipip 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyipip 0.1.1
File Size Uploaded Provenance Actions
pyipip-0.1.1.tar.gz 3.6 kB Without provenance Details for pyipip-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pyipip 0.1.1
File Interpreter ABI Platform Actions
pyipip-0.1.1-py2.py3-none-any.whl Python 2, Python 3 none any Details for pyipip-0.1.1-py2.py3-none-any.whl

Total release size: 8.9 kB

Release files / pyipip-0.1.1.tar.gz

Download URL pyipip-0.1.1.tar.gz
Size 3.6 kB
Tags Source
SHA-256 checksum
How to use checksums
9ec2e6c5fcaf61fe31249d28a2df80b9dd72b3dec84e8fb96c2def4449e44e04
BLAKE2b-256 checksum
How to use checksums
0a2bd813125809494b224da59b3020264f616d3a0c746e54fbac2f8589de19ed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / pyipip-0.1.1-py2.py3-none-any.whl

Download URL pyipip-0.1.1-py2.py3-none-any.whl
Size 5.4 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
c16c01f05da3c48352518074576e26221056497d4400236846c4e4dd205e871c
BLAKE2b-256 checksum
How to use checksums
b568f5e3868c60c377468e31391ff2312244944dc21b53280cad3a082ffd1cc8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for pyipip 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page