Update README.md

This commit is contained in:
M-307 2022-07-18 12:24:30 +07:00
parent 3b9e60d506
commit fa524c8219

View File

@ -1,13 +1,13 @@
# Enka Network Python # Enka Network Python
EN | [TH](./README_TH.md) EN | [TH](https://github.com/mrwan200/EnkaNetwork.py/blob/master/README_TH.md)
Library for API wrapper data from site https://enka.network/ Library for API wrapper data from site https://enka.network/
# 🏓 Table of content # 🏓 Table of content
## Table of Content
- [💾 Installation](#installation) - [💾 Installation](#installation)
- [✨ Usage](#usage) - [✨ Usage](#usage)
- [👀 Example](#example) - [👀 Example](#example)
- [📗 Class Methods](#class-methods)
- [🚧 Structure](#structure) - [🚧 Structure](#structure)
- [Player](#player) - [Player](#player)
- [Namecard](#namecard) - [Namecard](#namecard)
@ -68,6 +68,13 @@ Cache timeout: 300
## Example ## Example
Please see in [example](./example/) folder. Please see in [example](./example/) folder.
# Class Methods
| Name | Description |
|------------|-----------------|
| fetch_user(uid) | Fetch user data |
| set_language(lang) | Set new language <br> Please see [Languages Supported](#languages-supported) |
| update_assets() | Update new assets from repo [Enkanetwork.py Data](https://github.com/mrwan200/enkanetwork.py-data/) |
# Structure # Structure
## Player ## Player
| Wrapper | API | Notes | | Wrapper | API | Notes |
@ -192,7 +199,7 @@ In FIGHT_PROP data. You can get the value from 4 ways.
## Element Type ## Element Type
| Key | Value | | Key | Value |
|---------------|---------------| |---------------|---------------|
| Cyro | Ice | | Cryo | Ice |
| Hydro | Water | | Hydro | Water |
| Anemo | Wind | | Anemo | Wind |
| Pyro | Fire | | Pyro | Fire |
@ -232,12 +239,12 @@ import asyncio
from enkanetwork import Assets from enkanetwork import Assets
assets = Assets(lang="th") # Set languege before get name (Ex. Thai) assets = Assets(lang="en") # Set languege before get name (Ex. English)
async def main(): async def main():
print(assets.get_hash_map(1940919994)) # Hu tao print(assets.get_hash_map(1940919994)) # Hu tao
# OR you can get FIGHT_PROP name # OR you can get FIGHT_PROP name
print(assets.get_hash_map("FIGHT_PROP_BASE_ATTACK")) # พลังโจมตีพื้นฐาน (Base ATK) print(assets.get_hash_map("FIGHT_PROP_BASE_ATTACK")) # Base ATK
loop = asyncio.get_event_loop() loop = asyncio.get_event_loop()
loop.run_until_complete(main()) loop.run_until_complete(main())