Skip to main content

IPIP.net官方支持维护的IP数据库datx格式解析代码库

Project description

# Python解析datx格式的示例

## 安装说明 <pre> <code>pip install ipip-datx</code> </pre> ## 代码示例 <pre><code> import datx

# 查询地级市精度的IP库 c = datx.City(“/path/to/mydata4vipday2.datx”) print(c.find(“8.8.8.258”)) print(c.find(“255.255.255.255”))

# 查询国内区县库 d = datx.District(“/path/to/quxian.datx”) print(d.find(“123.121.117.72”))

# 查询基站IP库 d = datx.BaseStation(“/path/to/station_ip.datx”) print(d.find(“223.221.121.0”)) </code></pre>

Project details


Download files

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

Files for ipip-datx, version 0.3
Filename, size File type Python version Upload date Hashes
Filename, size ipip-datx-0.3.tar.gz (2.6 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page