用于tagpro.eu匹配的python解析器
tagpro-eu的Python项目详细描述
说明
这个包提供了一个简单的界面,用于读取从stat collection网站tagpro.eu(通过ronding)下载的匹配文件。其用途包括但不限于:
- 从比赛中收集个人球员的数据
- 漂亮地打印匹配结果
- 输出完全匹配时间线
- tagpro匹配的统计分析
- 渲染贴图
安装
使用pip(python 3.6+)安装:
pip install tagpro-eu
从源安装:
git clone git@github.com:arfie/tagpro-eu-python.git cd tagpro-eu-python sudo python3 setup.py install # or: python3 setup.py install --user # to install for current user only
快速启动
>>> import tagpro_eu
下载ID为1743331的联机匹配项。也可以给出匹配的url或原始数据url,而不是id。
>>> match = tagpro_eu.download_match(1743331) >>> match Match(server='tagpro-radius.koalabeast.com', port=8003)
了解基本匹配信息:
>>> match.date datetime.datetime(2018, 1, 19, 3, 47, 26)
找出匹配结果:
>>> (match.team_red.score, match.team_blue.score) (1, 3)
查找播放器:
>>> match.players[7] Player(name='LiddiLidd')
读取玩家数据。时间值是自动格式化的,但内部只是表示帧数(1/60秒)的整数。
>>> match.players[7].stats.captures 2 >>> match.players[7].stats.hold 00:58.12
访问匹配的地图:
>>> match.map Map(name='Constriction') >>> (match.map.width, match.map.height) (59, 25)
以二维数组的形式读取地图分幅:
>>> match.map.tiles[20][8] <Tile.flag_red: 30>