You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
1.6 KiB
Markdown

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<div align="center">
<img height="100px" alt="logo" src="https://img-bohe.lolicon.team/i/img/svg/logo.ico"/>
<p><em>AyasakiMoe Studio</em></p>
</div>
# 项目名称
- Name: 纯真IP转ip2region
- Convert Free QQWry IP Database to ip2region.db
- 原项目https://github.com/lionsoul2014/ip2region
# Ip2region 是什么
是一个离线IP地址定位库和IP定位数据管理框架10微秒级别的查询效率
- 标准化的数据格式
- 体积小
- 多查询客户端的支持
每个 ip 数据段的 region 信息都固定了格式:`国家|区域|省份|城市|ISP`只有中国的数据绝大部分精确到了城市其他国家部分数据只能定位到国家后前的选项全部是0。
# 安装
## 环境安装
1. `python3.10`以上
2. `java8`
拉取库
```python
pip install -r requirements.txt
```
# 使用
## 一键使用
你需要在[纯真免费IP库](https://www.cz88.net/help?id=free)中下载或者运行`download.py`获取
1. 安装后运行出现GUI界面点击下方的解压
2. 命名为`ip.txt`存放到data目录中
3. 由于默认编码为`ANSI`把编码格式重新改为`UTF-8`
运行`run.bat`
## 如何创建ip.merge.txt
你需要在[纯真免费IP库](https://www.cz88.net/help?id=free)中下载或者运行`download.py`获取
1. 安装后运行出现GUI界面点击下方的解压
2. 命名为`ip.txt`存放到data目录中
3. 由于默认编码为`ANSI`把编码格式重新改为`UTF-8`
```python
python main.py
```
## 如何创建ip2region.db
```java
java -Dfile.encoding=utf-8 -jar dbMaker-1.2.2.jar -src data/ip.merge.txt -region data/global_region.csv
```
# 其他备注