From 132221b4943d6045cbdbea9aa0d234538a328091 Mon Sep 17 00:00:00 2001 From: lionsoul2014 Date: Thu, 26 Feb 2026 14:08:10 +0800 Subject: [PATCH] add english readme for python maker --- README.md | 2 +- README_zh.md | 2 +- maker/python/README.md | 24 ++++++++++++----------- maker/python/README_zh.md | 40 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 55 insertions(+), 13 deletions(-) create mode 100644 maker/python/README_zh.md diff --git a/README.md b/README.md index f21f5ac..57a27a7 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,7 @@ For API introductions, usage documentation, and test programs, please refer to t | --- | --- | --- | --- | | [Golang](maker/golang/README.md) | golang xdb generation program | :white_check_mark: | :white_check_mark: | | [Java](maker/java/README.md) | java xdb generation program | :white_check_mark: | :white_check_mark: | -| [Python](maker/python) | python xdb generation program | :white_check_mark: | :x: | +| [Python](maker/python/README.md) | python xdb generation program | :white_check_mark: | :x: | | [Csharp](maker/csharp) | csharp xdb generation program | :white_check_mark: | :x: | | [Rust](maker/rust/README.md) | rust xdb generation program | :white_check_mark: | :white_check_mark: | | [C++](maker/cpp) | C++ xdb generation program | :white_check_mark: | :white_check_mark: | diff --git a/README_zh.md b/README_zh.md index d6e93c0..b6830fe 100644 --- a/README_zh.md +++ b/README_zh.md @@ -68,7 +68,7 @@ API 介绍,使用文档和测试程序请参考如下 `maker` 生成程序下 | --- | --- | --- | --- | | [Golang](maker/golang/README_zh.md) | golang xdb 生成程序 | :white_check_mark: | :white_check_mark: | | [Java](maker/java/README_zh.md) | java xdb 生成程序 | :white_check_mark: | :white_check_mark: | -| [Python](maker/python) | python xdb 生成程序 | :white_check_mark: | :x: | +| [Python](maker/python/README_zh.md) | python xdb 生成程序 | :white_check_mark: | :x: | | [Csharp](maker/csharp) | csharp xdb 生成程序 | :white_check_mark: | :x: | | [Rust](maker/rust/README_zh.md) | rust xdb 生成程序 | :white_check_mark: | :white_check_mark: | | [C++](maker/cpp) | C++ xdb 生成程序 | :white_check_mark: | :white_check_mark: | diff --git a/maker/python/README.md b/maker/python/README.md index dde00a3..c3efa0c 100644 --- a/maker/python/README.md +++ b/maker/python/README.md @@ -1,10 +1,11 @@ -# ip2region xdb python 生成实现 +:globe_with_meridians: [中文简体](README_zh.md) | [English](README.md) +# ip2region xdb python generation implementation -# 脚本执行 +# Script Execution ``` -# 切换到python maker 根目录 +# cd to the python maker root directory > python main.py ip2region xdb maker main.py [command] [command options] @@ -12,9 +13,10 @@ Command: gen generate the binary db file ``` -# `xdb` 数据生成 +# `xdb` Data Generation + +Generate the ip2region_v4.xdb binary file via the `python main.py gen` command: -通过 `python main.py gen` 命令生成 ip2region.xdb 二进制文件: ``` ➜ python git:(v2.0_xdb) ✗ python main.py gen main.py gen [command options] @@ -23,16 +25,16 @@ options: --dst string destination binary xdb file path ``` -例如,使用默认的 data/ip.merge.txt 作为源数据,生成一个 ip2region.xdb 到当前目录: +For example, using the default data/ipv4_source.txt as the source data to generate an ip2region_v4.xdb in the current directory: + ``` -➜ python git:(v2.0_xdb) ✗ python main.py gen --src=../../data/ip.merge.txt --dst=./ip2region.xdb -# 会看到一堆输出,最终会看到类似如下输出表示运行结束 +➜ python git:(v2.0_xdb) ✗ python main.py gen --src=../../data/ipv4_source.txt --dst=./ip2region_v4.xdb +# You will see a lot of output; eventually, you will see something like the following output indicating the end of the execution ... 2022-07-13 19:58:00,540-root-238-INFO - write done, dataBlocks: 13804, indexBlocks: (683591, 720221), indexPtr: (982904, 11065984) 2022-07-13 19:58:00,540-root-63-INFO - Done, elapsed: 3m3s ``` +# `xdb` Data Query and bench Test -# `xdb` 数据查询 和 bench 测试 - -基于xdb 格式的查询功能和测试见 [ip2region binding](../../binding) +For query functions and testing based on the xdb format, see ip2region [bindings](../../binding) diff --git a/maker/python/README_zh.md b/maker/python/README_zh.md new file mode 100644 index 0000000..4124f3c --- /dev/null +++ b/maker/python/README_zh.md @@ -0,0 +1,40 @@ +:globe_with_meridians: [中文简体](README_zh.md) | [English](README.md) + +# ip2region xdb python 生成实现 + + +# 脚本执行 + +``` +# 切换到python maker 根目录 +> python main.py +ip2region xdb maker +main.py [command] [command options] +Command: + gen generate the binary db file +``` + +# `xdb` 数据生成 + +通过 `python main.py gen` 命令生成 ip2region_v4.xdb 二进制文件: +``` +➜ python git:(v2.0_xdb) ✗ python main.py gen +main.py gen [command options] +options: + --src string source ip text file path + --dst string destination binary xdb file path +``` + +例如,使用默认的 data/ipv4_source.txt 作为源数据,生成一个 ip2region_v4.xdb 到当前目录: +``` +➜ python git:(v2.0_xdb) ✗ python main.py gen --src=../../data/ipv4_source.txt --dst=./ip2region_v4.xdb +# 会看到一堆输出,最终会看到类似如下输出表示运行结束 +... +2022-07-13 19:58:00,540-root-238-INFO - write done, dataBlocks: 13804, indexBlocks: (683591, 720221), indexPtr: (982904, 11065984) +2022-07-13 19:58:00,540-root-63-INFO - Done, elapsed: 3m3s +``` + + +# `xdb` 数据查询 和 bench 测试 + +基于xdb 格式的查询功能和测试见 ip2region [binding](../../binding)