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.
Source Distribution
ipip-datx-0.3.tar.gz
(2.6 kB
view hashes)