本仓库提供了一组用于操作xihe数据的脚本,包括以下内容:
| 脚本 | 描述 |
|---|---|
| whitelist.py | 添加白名单 |
| promotion_generator.py | 添加活动信息 |
- python 3.12.3+
- openpyxl 3.1.5
- pymongo 4.8.0
pip install -r requirements.txt配置mongo连接信息
config.ini
[test.mongo]
# 用户名
rwuser =
# 密码
password =
ip =
port =
# 库
database =
# ca文件,未使用值为空
cafile =
[prod.mongo]
# ...单条添加
usage: whitelist.py manual [-h] -u USERNAME [-t TYPE] --start_time START_TIME --end_time END_TIME [--enabled ENABLED]
insert account manually
options:
-h, --help show this help message and exit
-u USERNAME, --username USERNAME
xihe account
-t TYPE, --type TYPE allowed module
--start_time START_TIME
timestamp like "2024-06-12 09:27:00"
--end_time END_TIME timestamp like "2024-06-12 09:27:00"
--enabled ENABLED open or block permission [true/false]批量添加
usage: whitelist.py batch [-h] -f FILENAME
insert accounts in batch
options:
-h, --help show this help message and exit
-f FILENAME, --filename FILENAME
the excel of whitelist批量添加文件模板请使用这里
usage: promotion_generator.py [-h] -f FILENAME
options:
-h, --help show this help message and exit
-f FILENAME, --filename FILENAME
the excel of promotions批量添加文件模板请使用这里