![Python package](https://github.com/mrtolkien/lol_esports_parser/workflows/Python%20package/badge.svg)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
# Leaguepedia Esports Parser
A utility to transform LoL games data from both QQ and ACS into a single Data Transfer Object
This was developed in partnership between T1 and Leaguepedia staff.
# Usage
Test can be found in the `_tests` folder.
```python
import lol_esports_parser
# The package relies on match history URLs
# Both QQ and WP are support for Chinese games
# QQ
lpl_spring_finals = lol_esports_parser.get_qq_series("http://lol.qq.com/match/match_data.shtml?bmid=6131")
lpl_spring_finals["score"] # {"JDG": 3, "TES": 2}
# WP
lpl_summer_series = lol_esports_parser.get_wp_series("https://www.wanplus.com/schedule/63496.html")
lpl_summer_series["score"] # {"FPX": 2, "RNG": 1}
lck_spring_finals_g1 = lol_esports_parser.get_riot_game("https://matchhistory.na.leagueoflegends.com/en/#match-details/ESPORTSTMNT03/1353193?gameHash=63e4e6e5d695f410")
lck_spring_finals_g1["winner"] # "RED"
lck_spring_finals_g1["teams"]["RED"]["name"] # "T1"
```
# Configuration
## Environment variables
Expected environment variables can be found in the `template.env` file in this repository:
```dotenv
# Queries retries settings
LOL_ESPORTS_PARSER_MAX_RETRIES=2
LOL_ESPORTS_PARSER_RETRY_DELAY=10
# A Riot username and password are required for pro match history
RIOT_USERNAME=xxx
RIOT_PASSWORD=xxx
# A Riot API key is required for amateur matches played on the live server
RIOT_API_KEY=xxx
```
To load a `.env` file in python, you can use [python-dotenv](https://pypi.org/project/python-dotenv/) which offers a
very simple syntax to load environment variables with `dotenv.load_env()`.
Alternatively, you can directly use `os.environ[key] = value` inside your python scripts, but they need to be set before
you load `lol_esports_parser`.
## Endpoints configuration and Docker mounting
Endpoints are stored in a file called `endpoints.json` located at `~/.config/lol_esports_parser`.
To access this local file inside of a docker container, you can use this mounting syntax (Windows example):
```powershell
--mount type=bind, \
source=C:\Users\USERNAME\.config\lol_esports_parser, \
target=/usr/.config/lol_esports_parser \
```
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
资源分类:Python库 所属语言:Python 资源全名:lol_esports_parser-0.1a40.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
资源推荐
资源详情
资源评论
收起资源包目录
lol_esports_parser-0.1a40.tar.gz (27个子文件)
lol_esports_parser-0.1a40
PKG-INFO 398B
lol_esports_parser.egg-info
PKG-INFO 398B
requires.txt 120B
SOURCES.txt 933B
top_level.txt 19B
dependency_links.txt 1B
setup.cfg 42B
setup.py 762B
README.md 2KB
lol_esports_parser
logger.py 87B
dto
qq_source.py 113B
__init__.py 0B
wp_dto.py 933B
series_dto.py 2KB
__init__.py 255B
config.py 1KB
parsers
riot
acs_access.py 3KB
__init__.py 0B
riot_parser.py 5KB
__init__.py 0B
runes_handler.py 3KB
qq
__init__.py 0B
qq_parser.py 17KB
qq_access.py 4KB
wp
wp_access.py 4KB
__init__.py 0B
wp_parser.py 23KB
共 27 条
- 1
资源评论
挣扎的蓝藻
- 粉丝: 14w+
- 资源: 15万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功