明日方舟(Arknights) 相关功能的整合库
现拥有如下功能:
- 抽卡
- 模拟十连
- 随机干员生成
- 公招链接生成
- 猜干员游戏
- 抽卡结果查询
欢迎 PR
pip install arknights-toolkit
pdm add arknights-toolkit
arknights-toolkit
配套了 cli 工具用于资源下载:
初始化数据与图片资源:
arkkit init
更新抽卡卡池:
arkkit update gacha path/to/gacha.json
from arknights_toolkit.gacha import ArknightsGacha, GachaUser
from arknights_toolkit.gacha.simulate import simulate_image
from pathlib import Path
import asyncio
async def main():
gacha = ArknightsGacha("path/to/gacha.json")
user = GachaUser()
data = gacha.gacha(user, 10)
img = await simulate_image(data[0])
with Path("example_sim.png").open("wb+") as f:
f.write(img)
asyncio.run(main())
抽卡结果: