Query IP geolocation/ISP via direct requests to toola.hiofd.com (no browser dependency)
Project description
IP-hiofd
通过 https://toola.hiofd.com/router/rest 直连查询 IP 信息。
输出字段:
- IP地址
- 网络服务商
- 位置(IP归属地)
- 区
- 街道
- 纬度
- 经度
安装
作为 Python 包安装
pip install ip-hiofd
开发环境安装
git clone https://github.com/Qoo-330ml/IP-hiofd
cd IP-hiofd
python3 -m venv .venv
source .venv/bin/activate
python -m pip install -r requirements.txt
Python 命令行
ip-hiofd --ip=61.175.188.57
ip-hiofd --ip=61.175.188.57 --json
ip-hiofd --ip=61.175.188.57 --timeout 30 --retries 5 --retry-delay 1.5
ip-hiofd --ip=2408:8440:7a80:1df:d0db:53ff:fe1b:410e
Python 作为库调用
from ip_hiofd import HiofdIpClient
client = HiofdIpClient()
result = client.lookup('61.175.188.57')
print(result.isp, result.location, result.district, result.street)
print(result.latitude, result.longitude)
或快捷函数:
from ip_hiofd.client import lookup_ip
result = lookup_ip('117.152.147.151')
print(result)
目录说明
ip_hiofd/:Python 包ip_hiofd/client.py:纯 requests 实现ip_hiofd_api.py:兼容旧用法的 Python CLI 封装
说明
- 请求参数
k/t/x/r由本地算法生成并直连查询。 - 支持 IPv4 和 IPv6 地址查询。
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
ip_hiofd-0.3.1.tar.gz
(5.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ip_hiofd-0.3.1.tar.gz.
File metadata
- Download URL: ip_hiofd-0.3.1.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
baca1a8aca400c81b88b4ce2e452401aa95e77f2e19a7f9a405333d56e13c893
|
|
| MD5 |
629761ae339e0c0606cfc73ac59c1a40
|
|
| BLAKE2b-256 |
81ffa03f9c1dbcd21cd4e212d114ea46bd7ea5e789536d7571024c895e4beb89
|
File details
Details for the file ip_hiofd-0.3.1-py3-none-any.whl.
File metadata
- Download URL: ip_hiofd-0.3.1-py3-none-any.whl
- Upload date:
- Size: 5.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c6791e6cfbb463085007001c2806950792351b188d43a15204c65bf6e3cf6b42
|
|
| MD5 |
e6427fd3ab7fbc173f69f5f0563768f7
|
|
| BLAKE2b-256 |
2e72d920038d0fa67b2be46f4dac9c6f41f9174b275475f60d13a8fbeb23423e
|