https://github.com/dp0973/pyddragon
Python wrapper that handles LoL ddragon data asynchronously
https://github.com/dp0973/pyddragon
asynchronous league-of-legends python-3 riot-games-api wrapper-library
Last synced: 6 months ago
JSON representation
Python wrapper that handles LoL ddragon data asynchronously
- Host: GitHub
- URL: https://github.com/dp0973/pyddragon
- Owner: dp0973
- License: apache-2.0
- Created: 2021-09-13T15:16:19.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-04-18T01:44:44.000Z (about 4 years ago)
- Last Synced: 2025-03-22T08:17:04.209Z (about 1 year ago)
- Topics: asynchronous, league-of-legends, python-3, riot-games-api, wrapper-library
- Language: Python
- Homepage:
- Size: 29.3 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pyddragon
[](https://pypi.com/project/pyddragon)
[](https://pypi.com/project/pyddragon)
[](https://pypi.com/project/pyddragon/)
[](https://pypi.python.org/pypi/pyddragon)
Python wrapper library providing LoL ddragon data asynchronously
## Features
- Asynchronous
- Supports various search types in a method
- Returns class to get details easily
## Installation
```
pip install pyddragon
```
## Contact & Suggestion
Feel free to open a pull request or issue!
## Example Code
```py
import asyncio
from pyddragon.ddragon import Ddragon
async def main():
async with Ddragon() as dd:
ch_by_name = await dd.get_champion("Aurelion Sol", "name")
ch_by_id = await dd.get_champion("AurelionSol")
ch_by_key = await dd.get_champion(136) # "136" is available
print(f"{ch_by_name.name} - {ch_by_name.id} - {ch_by_name.key}")
print(f"{ch_by_id.name} - {ch_by_id.id} - {ch_by_id.key}")
print(f"{ch_by_key.name} - {ch_by_key.id} - {ch_by_key.key}")
print(f"\n{ch_by_name.blurb}\n")
it_by_name = await dd.get_item("Sorcerer's Shoes")
it_by_id = await dd.get_item(3020)
print(f"{it_by_name.name} - {it_by_name.id}")
print(f"{it_by_id.name} - {it_by_id.id}")
print(f"\n{it_by_name.plaintext}\n")
ru_by_name = await dd.get_rune("Prototype: Omnistone", "name")
ru_by_id = await dd.get_rune("MasterKey")
ru_by_key = await dd.get_rune(8358)
print(f"{ru_by_name.name} - {ru_by_name.id} - {ru_by_name.key}")
print(f"{ru_by_id.name} - {ru_by_id.id} - {ru_by_id.key}")
print(f"{ru_by_key.name} - {ru_by_key.id} - {ru_by_key.key}")
print(f"\n{ru_by_name.short_desc}\n")
su_by_name = await dd.get_summoner("Barrier", "name")
su_by_id = await dd.get_summoner("SummonerBarrier")
su_by_key = await dd.get_summoner(21)
print(f"{su_by_name.name} - {su_by_name.id} - {su_by_name.key}")
print(f"{su_by_id.name} - {su_by_id.id} - {su_by_id.key}")
print(f"{su_by_key.name} - {su_by_key.id} - {su_by_key.key}")
print(f"\n{su_by_name.image}\n")
asyncio.run(main())
```
Output:
```
Aurelion Sol - AurelionSol - 136
Aurelion Sol - AurelionSol - 136
Aurelion Sol - AurelionSol - 136
Aurelion Sol once graced the vast emptiness of the cosmos with celestial wonders of his own devising. Now, he is forced to wield his awesome power at the behest of a space-faring empire that tricked him into servitude. Desiring a return to his...
Sorcerer's Shoes - 3020
Sorcerer's Shoes - 3020
Enhances Movement Speed and magic damage
Prototype: Omnistone - MasterKey - 8358
Prototype: Omnistone - MasterKey - 8358
Prototype: Omnistone - MasterKey - 8358
Periodically grants a single use of another random keystone.
Barrier - SummonerBarrier - 21
Barrier - SummonerBarrier - 21
Barrier - SummonerBarrier - 21
SummonerBarrier.png
```