Skip to main content

a geographic information database

Project description

XdbLocation

是一个离线IP地址定位库和IP定位数据管理的库

安装

稳定版本

要安装Xdb_Location,请在终端中运行以下命令:

uv add xdb_location

或者,如果你更喜欢使用 pip:

pip install xdb_location

源码安装

Xdb_Location的源文件可以从以下网址下载 Github repo.

您可以克隆公共存储库:

git clone git://github.com/gunhe/xdb_location

一旦你有了源代码的副本,你就可以用以下方式安装它:

cd xdb_location
uv pip install .

使用

from xdb_location.xdb_location import searchWithContent
target_ip_location = searchWithContent(target_ip="1.15.241.228")
print(target_ip_location)

最佳实践

# 程序启动前把 searchWithContent 对象缓存下来,做成一个全局对象
from xdb_location.xdb_location import searchWithContentCache

# 使用searchWithContent 对象来查询
searcher = searchWithContentCache()
target_ip_location = searcher.search("1.15.241.228")
print(target_ip_location)

# 程序结束时候释放内存空间
searcher.close()

数据生成

git clone https://github.com/gunhe/xdb_location.git
cd xdb_location
# 测试数据生成
uv run xdb_location ./src/xdb_location/data/ip.test.txt ./ip2region.test.xdb
# ipv4 数据生成
uv run xdb_location ./src/xdb_location/data/ipv4_source.txt ./ip2region.ipv4_source.xdb
# ipv6 数据生成
uv run xdb_location ./src/xdb_location/data/ipv6_source.txt ./ip2region.ipv6_source.xdb

参考

uv

Publishing your package

Using uv in GitHub Actions

Typer

Cookiecutter

audreyfeldroy/cookiecutter-pypackage

https://github.com/lionsoul2014/ip2region

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

xdb_location-0.1.35.tar.gz (32.8 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xdb_location-0.1.35-py3-none-any.whl (32.8 MB view details)

Uploaded Python 3

File details

Details for the file xdb_location-0.1.35.tar.gz.

File metadata

  • Download URL: xdb_location-0.1.35.tar.gz
  • Upload date:
  • Size: 32.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for xdb_location-0.1.35.tar.gz
Algorithm Hash digest
SHA256 6960ee1b51dfb6654f8ded3b51e9f0219e3d031dd84d25d5cb1132b77888a718
MD5 4f6ce97985f73532380c45f87bdc000a
BLAKE2b-256 f99a3104476ead4412cd38344a9952ac88347c325ff4db8863d750b5dd5b9c0d

See more details on using hashes here.

File details

Details for the file xdb_location-0.1.35-py3-none-any.whl.

File metadata

  • Download URL: xdb_location-0.1.35-py3-none-any.whl
  • Upload date:
  • Size: 32.8 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for xdb_location-0.1.35-py3-none-any.whl
Algorithm Hash digest
SHA256 99e11062f72f4f53b94b5f8133273cef63b046d36160ffcc36d42a1e6a1c73f3
MD5 e416406091ba4d626834addf0beaae34
BLAKE2b-256 2356c74aee79196e191019b83fc7dad9a446be910b24eb3d6cb93c916d24f5f9

See more details on using hashes here.

Supported by

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