From 9e2624d14ace6823dd5690e20968af7f25033663 Mon Sep 17 00:00:00 2001 From: "user.email" <0kq@0kqnet.work> Date: Thu, 6 Jul 2023 15:00:37 +0900 Subject: [PATCH 1/8] add README_JP.md (WIP) --- README_JP.md | 424 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 424 insertions(+) create mode 100644 README_JP.md diff --git a/README_JP.md b/README_JP.md new file mode 100644 index 0000000..7a553fb --- /dev/null +++ b/README_JP.md @@ -0,0 +1,424 @@ +# Enka Network Python + +EN | [TH](https://github.com/mrwan200/EnkaNetwork.py/blob/master/README_TH.md) | [JP](https://github.com/mrwan200/EnkaNetwork.py/blob/master/README_JP.md) + +https://enka.network/ のAPIラッパーライブラリ + +# 🏓 目次 + +- [💾 インストール](#インストール) +- [✨ 使い方](#使い方) +- [👀 使用例](#使用例) +- [📗 メソッド一覧](#メソッド一覧) +- [📥 レスポンス](#レスポンス) + - [UID](#uid) + - [プロフィール](#プロフィール) +- [🚧 データ構造](#データ構造) + - [プレイヤーオーナー](#プレイヤーオーナー) + - [Profile patreon](#profile-patreon) + - [Profile Hoyos](#profile-hoyos) + - [Build(s) info](#avatar-builds-info) + - [Profile info](#profile-info) + - [Player](#プレイヤー) + - [Namecard](#namecard) + - [Avatar Icon](#avatar-icon) + - [Character preview](#character-preview) + - [Characters](#characters) + - [Icon](#icon) + - [Constellation](#constellation) + - [Skill](#skill) + - [Equipments (Artifact, Weapon)](#equipments-artifact-weapon) + - [Equipments Info](#equipments-info) + - [Equipments Stats](#equipments-stats) + - [FIGHT_PROP Data](#fight_prop-data) + - [Build(s)](#build) +- [🔧 Assets](#assets) + - [Character, constellations, skills, namecards](#assets-character-constellations-skills-namecards) + - [NameTextMapHash](#assets-nametextmaphash) +- [🌎 言語のサポート](#言語のサポート) +- [🙋 Support & Question](#support--question) +- [📄 LICENSE](#license) + +# インストール + +``` +pip install enkanetwork.py +``` + +# 使い方 + +```py +import asyncio + +from enkanetwork import EnkaNetworkAPI + +client = EnkaNetworkAPI() + +async def main(): + async with client: + data = await client.fetch_user(843715177) + print("=== Player Info ===") + print(f"Nickname: {data.player.nickname}") + print(f"Level: {data.player.level}") + print(f"Icon: {data.player.avatar.icon.url}") + print(f"Signature: {data.player.signature}") + print(f"Achievement: {data.player.achievement}") + print(f"Abyss floor: {data.player.abyss_floor} - {data.player.abyss_room}") + print(f"Cache timeout: {data.ttl}") + +asyncio.run(main()) +``` + +## 出力 + +```sh +=== Player Info === +Nickname: mrwan2546 +Level: 55 +Icon: https://enka.network/ui/UI_AvatarIcon_Kazuha.png +Signature: K A Z U H A M U C H <3 +Achievement: 396 +Abyss floor: 8 - 3 +Cache timeout: 300 +``` + +## 使用例 + +[example](./example/) 参照 + +# メソッド一覧 + +| メソッド名 | 詳細 | +| ----------------------------------- | --------------------------------------------------------------------------------------------------- | +| fetch_user(uid) | ユーザーデータの取得 (UID) **(まもなく廃止されます)** | +| fetch_user_by_uid(uid) | ユーザーデータの取得 (UID) | +| fetch_user_by_username(profile_id) | ユーザーデータの取得 (プロフィールID) **(For subscriptions in Enka.Network)** | +| fetch_hoyos_by_username(profile_id) | hoyosのユーザーデータの取得 (プロフィールID) **(For subscriptions in Enka.Network)** | +| fetch_builds(profile_id, metaname) | ビルドデータの取得 (プロフィールID) **(For subscriptions in Enka.Network)** | +| set_language(lang) | 言語の設定
[言語のサポート](#言語のサポート) 参照 | +| update_assets() | [Enkanetwork.py Data](https://github.com/mrwan200/enkanetwork.py-data/) からアセットを更新します。 | + +# レスポンス + +## UID + +戻り値の型: `EnkaNetworkResponse` +| ラッパー | API | 備考 | +| ---------- | -------------- | ------------------------------------------ | +| player | playerInfo | [プレイヤー](#プレイヤー) を参照 | +| characters | avatarInfoList | [キャラクター](#characters) を参照 | +| profile | - | [プロフィール情報](#プロフィール情報) を参照 | +| owner | owner | [プレイヤーオーナー](#プレイヤーオーナー) を参照 | +| ttl | ttl | | +| uid | uid | | + +## プロフィール + +戻り値の型: `EnkaNetworkProfileResponse` +| ラッパー | API | 備考 | +| -------- | ---------- | --------------------------------------------------- | +| username | playerInfo | [プレイヤー](#プレイヤー) を参照 | +| profile | profile | [Patreonプロフィール](#profile-patreon) を参照 | +| hoyos | hoyos | [hoyosプロフィール](#hoyosプロフィール) を参照 | + +# データ構造 + +## プレイヤーオーナー + +| ラッパー | API | 備考 | +| -------- | -------- | --------------------------------------------------- | +| hash | hash | | +| username | username | [Tier](#tier) を参照 | +| profile | profile | [Patreonプロフィール](#Patreonプロフィール) を参照 | +| builds | - | [ビルド情報](#avatar-builds-info) を参照 | + +## Patreonプロフィール + +| ラッパー | API | 備考 | +| ------------ | ------------ | -------------------------- | +| bio | bio | | +| level | level | [Tier](#tier) を参照 | +| profile | worldLevel | | +| signup_state | signup_state | | +| image_url | image_url | | + +## Hoyosプロフィール + +| ラッパー | API | 備考 | +| ------------ | ------------ | ------------------------------------------------ | +| uid_public | uid_public | | +| public | public | | +| verified | verified | | +| player_info | player_info | [Patreonプロフィール](#Patreonプロフィール) を参照 | +| signup_state | signup_state | | +| signup_state | signup_state | | + +## アバタービルド情報 + +| ラッパー | API | 備考 | +| ----------- | ----------- | -------------------------------------- | +| id | id | | +| name | name | | +| avatar_id | avatar_id | | +| avatar_data | avatar_data | [キャラクター](#キャラクター) を参照 | +| order | order | | +| live | live | | +| settings | settings | | +| public | public | | + +## プロフィール情報 + +| ラッパー | API | 備考 | +| ------- | --- | ------------------------------ | +| uid | - | ゲーム内UID | +| url | - | Enka.NetworkへのURL | +| path | - | URLのパス | + +## プレイヤー + +| ラッパー | API | 備考 | +| ------------------ | ------------------------ | ---------------------------------------------------- | +| nickname | nickname | [名刺](#名刺) を参照 | +| signature | signature | | +| world_level | worldLevel | | +| achievement | finishAchievementNum | | +| namecard | namecardId | | +| namecards | showNameCardIdList -> id | [名刺](#名刺) を参照 | +| abyss_floor | towerFloorIndex | | +| abyss_room | towerLevelIndex | | +| characters_preview | showAvatarInfoList | [Character Preview](#character-preview) を参照 | +| avatar | profilePicture | [Avatar Icon](#avatar-icon) を参照 | + +### Avatar icon + +| ラッパー | API | 備考 | +| ------- | -------- | ------------------------------------ | +| id | avatarId | | +| icon | | Please refer [Icon Data](#icon-data) | + +### 名刺 + +| ラッパー | API | 備考 | +| ------- | --- | ------------------------------------------------------------- | +| id | - | 名刺ID | +| name | - | 名刺の名前 | +| icon | - | 名刺アイコン, [Icon Data](#icon-data) を参照 | +| banner | - | 名刺のバナー, [Icon Data](#icon-data) を参照 | +| navbar | - | Namecard navbar (Alpha), Please refer [Icon Data](#icon-data) | + +### キャラクタープレビュー + +| ラッパー | API | 備考 | +| ------- | --- | ------------------------------------------------- | +| id | - | アバターID | +| name | - | アバター名 | +| level | - | アバターのレベル | +| icon | - | アバターアイコン, [Icon Data](#icon-data) を参照 | + +## Characters + +| ラッパー | API | 備考 | +| ----------------------- | ---------------------- | ------------------------------------------------------ | +| id | avatarId | | +| name | - | Avatar Name | +| element | - | Please refer [Element Type](#element-type) | +| rarity | - | Rarity | +| image | - | Please refer [Icon](#icon) | +| xp | propMap -> 1001 | | +| ascension | propMap -> 1002 | | +| level | propMap -> 4001 | | +| max_level | - | Avatar max level (Like 50/60) | +| friendship_level | fetterInfo.level | | +| equipments | equipList | Please refer [Equipments](#equipments-artifact-weapon) | +| stats | fightPropMap | Please refer [FIGHT_PROP Data](#fight_prop-data) | +| constellations | talentIdList | Please refer [Constellation](#constellation) | +| constellations_unlocked | - | Constellation unlocked | +| skill_data | inherentProudSkillList | | +| skill_id | skillDepotId | | +| skills | - | Please refer [Skill](#skill) | + +### Icon + +| ラッパー | API | 備考 | +| ------- | --- | -------------------------------------------------------- | +| icon | - | Avatar icon, Please refer [Icon Data](#icon-data) | +| side | - | Avatar side icon, Please refer [Icon Data](#icon-data) | +| banner | - | Avatar wish banner, Please refer [Icon Data](#icon-data) | + +### Constellation + +| ラッパー | API | 備考 | +| -------- | --- | -------------------------- | +| id | - | Constellation ID | +| name | - | Constellation Name | +| icon | - | Constellation Icon (URL) | +| unlocked | - | Constellation has unlocked | + +### Skill + +| ラッパー | API | 備考 | +| ---------- | --- | ----------------------- | +| id | - | Skill ID | +| name | - | Skill Name | +| icon | - | Skill Icon (URL) | +| level | - | Skill Level | +| is_boosted | - | Skill level has boosted | + +## Equipments (Artifact, Weapon) + +| ラッパー | API | 備考 | +| ---------- | ----------------------------------- | ------------------------------------------------ | +| id | itemId | | +| level | reliquary -> level, weapon -> level | +| type | - | Type of equipment (Artifact or Weapon) | +| refinement | weapon -> affixMap | | +| ascension | weapon -> promoteLevel | | +| detail | flat | Please refer [Equipments Info](#equipments-info) | + +### Equipments Info + +| ラッパー | API | 備考 | +| ------------- | ----------------------------------- | -------------------------------------------------- | +| name | - | Equipment Name (Artifact name or Weapon name) | +| icon | icon | Please refer [Icon Data](#icon-data) | +| artifact_type | - | Please refer [Artifact Type](#artifact-type) | +| rarity | rankLevel | | +| mainstats | reliquaryMainstat, weaponStats -> 0 | Please refer [Equipments Stats](#equipments-stats) | +| substats | reliquarySubstats, weaponStats -> 1 | Please refer [Equipments Stats](#equipments-stats) | + +### Equipments Stats + +| ラッパー | API | 備考 | +| ------- | ------- | ------------------------------ | +| prop_id | prop_id | | +| type | - | Value type (NUMBER or PERCENT) | +| name | - | Name of FIGHT_PROP | +| value | value | | + +## FIGHT_PROP Data + +In FIGHT_PROP data. You can get the value from 4 methods. +| Choice | Example | Output | +|------------------|---------------------------|----------------------------| +| Get raw value | stats.FIGHT_PROP_HP.value | 15552.306640625 | +| Get rounded value| stats.FIGHT_PROP_ATTACK.to_rounded() | 344 | +| Get percentage | stats.FIGHT_PROP_FIRE_ADD_HURT.to_percentage() | 61.5 | +| Get percentage and symbol | stats.FIGHT_PROP_FIRE_ADD_HURT.to_percentage_symbol() | 61.5% | + +## Build + +In this `Builds` It's not pretty data. You can use this method to get data. Or if you want get full, You can use `raw` argument +| Choice | Example | Output | +|------------------|---------------------------|----------------------------| +| Get avatar ID list | builds.get_avatar_list() | [10000021,10000037,10000025, ...] | +| Get character build | builds.get_character(10000021) | List of [Build info](#avatar-builds-info) | +| Get build info by avatar id | builds.get_character(10000021, 11111111) | [Build info](#avatar-builds-info) | + +# Icon Data + +In icon data. You can get the value from 2 methods. +| Choice | Example | Output | +|------------------|---------------------------|--------------------------------| +| Get filename | icon.filename | UI_AvatarIcon_Kazuha_Card.png | +| Get URL | icon.url | https://enka.network/ui/UI_AvatarIcon_Kazuha_Card.png | + +## Artifact Type + +| Key | Value | +| ------- | -------------- | +| Flower | EQUIP_BRACER | +| Feather | EQUIP_NECKLACE | +| Sands | EQUIP_SHOES | +| Goblet | EQUIP_RING | +| Circlet | EQUIP_DRESS | + +## Element Type + +| Key | Value | +| ------- | -------- | +| Cryo | Ice | +| Hydro | Water | +| Anemo | Wind | +| Pyro | Fire | +| Geo | Rock | +| Electro | Electric | + +# Assets + +## Assets character, constellations, skills, namecards + +You can use avatarId to get the character, constellations, skills, namecards from assets. + +```py +import asyncio + +from enkanetwork import Assets + +assets = Assets() + +async def main(): + # Character + assets.character(10000046) + # Constellations + assets.constellations(2081199193) + # Skills + assets.constellations(10462) + # Namecards + assets.namecards(210059) + +loop = asyncio.get_event_loop() +loop.run_until_complete(main()) +``` + +## Assets NameTextMapHash + +The `NameTextMapHash` is a hash map that contains the name text of the assets. You can get `NameTextMapHash` from `hash_id` like this: + +```py +import asyncio + +from enkanetwork import Assets + +assets = Assets(lang="en") # Set languege before get name (Ex. English) + +async def main(): + print(assets.get_hash_map(1940919994)) # Hu tao + # OR you can get FIGHT_PROP name + print(assets.get_hash_map("FIGHT_PROP_BASE_ATTACK")) # Base ATK + +loop = asyncio.get_event_loop() +loop.run_until_complete(main()) +``` + +## 言語のサポート + +| Languege | Code | +| ---------- | ---- | +| English | en | +| русский | ru | +| Tiếng Việt | vi | +| ไทย | th | +| português | pt | +| 한국어 | kr | +| 日本語 | jp | +| 中文 | zh | +| Indonesian | id | +| français | fr | +| español | es | +| deutsch | de | +| Taiwan | cht | +| Chinese | chs | + +If you want full docs for the API, visit [EnkaNetwork API Docs](https://github.com/EnkaNetwork/API-docs) + +## Support & Question + +If you need support or some question about EnkaNetwokt.py. You can feel free contact to me in [Enka.network discord server](https://discord.gg/G3m7CWkssY) in [𝖯𝖸┃enkanetwork․py](https://discord.com/channels/840335525621268520/1046281445049647104) channel and mention (Ping) to **@M-307** for support and help + +# LICENSE + +[MIT License](./LICENSE) + +![Keqing](https://c.tenor.com/MnkpnVCLcb0AAAAC/keqing-dance.gif) + +[Picture by KKOMDASTRO](https://twitter.com/KKOMDASTRO) From f3c4961d1c9d3b026de2128e117b7de44777dd54 Mon Sep 17 00:00:00 2001 From: "user.email" <0kq@0kqnet.work> Date: Thu, 6 Jul 2023 15:05:50 +0900 Subject: [PATCH 2/8] update readme --- README.md | 2 +- README_JP.md | 2 +- README_TH.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5cbf3cc..8cd9c2c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Enka Network Python -EN | [TH](https://github.com/mrwan200/EnkaNetwork.py/blob/master/README_TH.md) +EN | [TH](https://github.com/mrwan200/EnkaNetwork.py/blob/master/README_TH.md) | [JP](https://github.com/mrwan200/EnkaNetwork.py/blob/master/README_JP.md) Library for API wrapper data from site https://enka.network/ diff --git a/README_JP.md b/README_JP.md index 7a553fb..6e5d83e 100644 --- a/README_JP.md +++ b/README_JP.md @@ -1,6 +1,6 @@ # Enka Network Python -EN | [TH](https://github.com/mrwan200/EnkaNetwork.py/blob/master/README_TH.md) | [JP](https://github.com/mrwan200/EnkaNetwork.py/blob/master/README_JP.md) +[EN](./README.md) | [TH](./README_TH.md) | JP https://enka.network/ のAPIラッパーライブラリ diff --git a/README_TH.md b/README_TH.md index 4d75a88..3e76c49 100644 --- a/README_TH.md +++ b/README_TH.md @@ -1,5 +1,5 @@ # Enka Network Python -[EN](./README.md) | TH +[EN](./README.md) | TH | [JP](./README_JP.md) ไลบารีสำหรับดึงข้อมูล JSON จากเว็บ https://enka.network From 046da22f225d0aae67a208273452ea2113710425 Mon Sep 17 00:00:00 2001 From: "user.email" <0kq@0kqnet.work> Date: Mon, 10 Jul 2023 11:02:23 +0900 Subject: [PATCH 3/8] update README_JP.md --- README_JP.md | 216 +++++++++++++++++++++++++-------------------------- 1 file changed, 108 insertions(+), 108 deletions(-) diff --git a/README_JP.md b/README_JP.md index 6e5d83e..c86aa62 100644 --- a/README_JP.md +++ b/README_JP.md @@ -15,29 +15,29 @@ https://enka.network/ のAPIラッパーライブラリ - [プロフィール](#プロフィール) - [🚧 データ構造](#データ構造) - [プレイヤーオーナー](#プレイヤーオーナー) - - [Profile patreon](#profile-patreon) - - [Profile Hoyos](#profile-hoyos) - - [Build(s) info](#avatar-builds-info) - - [Profile info](#profile-info) + - [Patreonプロフィール](#Patreonプロフィール) + - [Hoyosプロフィール](#Hoyosプロフィール) + - [ビルド情報](#ビルド情報) + - [プロフィール情報](#プロフィール情報) - [Player](#プレイヤー) - - [Namecard](#namecard) - - [Avatar Icon](#avatar-icon) - - [Character preview](#character-preview) - - [Characters](#characters) - - [Icon](#icon) - - [Constellation](#constellation) - - [Skill](#skill) - - [Equipments (Artifact, Weapon)](#equipments-artifact-weapon) - - [Equipments Info](#equipments-info) - - [Equipments Stats](#equipments-stats) - - [FIGHT_PROP Data](#fight_prop-data) - - [Build(s)](#build) -- [🔧 Assets](#assets) - - [Character, constellations, skills, namecards](#assets-character-constellations-skills-namecards) - - [NameTextMapHash](#assets-nametextmaphash) + - [名刺](#名刺) + - [アバターアイコン](#アバターアイコン) + - [展示キャラクター一覧](#展示キャラクター一覧) + - [キャラクター](#キャラクター) + - [アイコン](#アイコン) + - [命ノ星座](#命ノ星座) + - [スキル](#スキル) + - [装備 (聖遺物, 武器)](#装備-聖遺物-武器) + - [装備情報](#装備情報) + - [装備ステータス](#装備ステータス) + - [FIGHT_PROPデータ](#fight_propデータ) + - [ビルド](#ビルド) +- [🔧 アセット](#アセット) + - [キャラクター, 命ノ星座, スキル, 名刺](#キャラクター-命ノ星座-スキル-名刺) + - [NameTextMapHash](#nametextmaphash) - [🌎 言語のサポート](#言語のサポート) -- [🙋 Support & Question](#support--question) -- [📄 LICENSE](#license) +- [🙋 サポートと質問](#サポートと質問) +- [📄 ライセンス](#ライセンス) # インストール @@ -84,7 +84,7 @@ Cache timeout: 300 ## 使用例 -[example](./example/) 参照 +[example](./example/) を参照 # メソッド一覧 @@ -92,10 +92,10 @@ Cache timeout: 300 | ----------------------------------- | --------------------------------------------------------------------------------------------------- | | fetch_user(uid) | ユーザーデータの取得 (UID) **(まもなく廃止されます)** | | fetch_user_by_uid(uid) | ユーザーデータの取得 (UID) | -| fetch_user_by_username(profile_id) | ユーザーデータの取得 (プロフィールID) **(For subscriptions in Enka.Network)** | -| fetch_hoyos_by_username(profile_id) | hoyosのユーザーデータの取得 (プロフィールID) **(For subscriptions in Enka.Network)** | -| fetch_builds(profile_id, metaname) | ビルドデータの取得 (プロフィールID) **(For subscriptions in Enka.Network)** | -| set_language(lang) | 言語の設定
[言語のサポート](#言語のサポート) 参照 | +| fetch_user_by_username(profile_id) | ユーザーデータの取得 (プロフィールID) **(Enka.Networkのサブスクライバー向け)** | +| fetch_hoyos_by_username(profile_id) | hoyosのユーザーデータの取得 (プロフィールID) **(Enka.Networkのサブスクライバー向け)** | +| fetch_builds(profile_id, metaname) | ビルドデータの取得 (プロフィールID) **(Enka.Networkのサブスクライバー向け)** | +| set_language(lang) | 言語の設定
[言語のサポート](#言語のサポート) を参照 | | update_assets() | [Enkanetwork.py Data](https://github.com/mrwan200/enkanetwork.py-data/) からアセットを更新します。 | # レスポンス @@ -106,7 +106,7 @@ Cache timeout: 300 | ラッパー | API | 備考 | | ---------- | -------------- | ------------------------------------------ | | player | playerInfo | [プレイヤー](#プレイヤー) を参照 | -| characters | avatarInfoList | [キャラクター](#characters) を参照 | +| characters | avatarInfoList | [キャラクター](#キャラクター) を参照 | | profile | - | [プロフィール情報](#プロフィール情報) を参照 | | owner | owner | [プレイヤーオーナー](#プレイヤーオーナー) を参照 | | ttl | ttl | | @@ -118,7 +118,7 @@ Cache timeout: 300 | ラッパー | API | 備考 | | -------- | ---------- | --------------------------------------------------- | | username | playerInfo | [プレイヤー](#プレイヤー) を参照 | -| profile | profile | [Patreonプロフィール](#profile-patreon) を参照 | +| profile | profile | [Patreonプロフィール](#Patreonプロフィール) を参照 | | hoyos | hoyos | [hoyosプロフィール](#hoyosプロフィール) を参照 | # データ構造 @@ -130,7 +130,7 @@ Cache timeout: 300 | hash | hash | | | username | username | [Tier](#tier) を参照 | | profile | profile | [Patreonプロフィール](#Patreonプロフィール) を参照 | -| builds | - | [ビルド情報](#avatar-builds-info) を参照 | +| builds | - | [ビルド情報](#ビルド情報) を参照 | ## Patreonプロフィール @@ -153,7 +153,7 @@ Cache timeout: 300 | signup_state | signup_state | | | signup_state | signup_state | | -## アバタービルド情報 +## ビルド情報 | ラッパー | API | 備考 | | ----------- | ----------- | -------------------------------------- | @@ -186,15 +186,15 @@ Cache timeout: 300 | namecards | showNameCardIdList -> id | [名刺](#名刺) を参照 | | abyss_floor | towerFloorIndex | | | abyss_room | towerLevelIndex | | -| characters_preview | showAvatarInfoList | [Character Preview](#character-preview) を参照 | -| avatar | profilePicture | [Avatar Icon](#avatar-icon) を参照 | +| characters_preview | showAvatarInfoList | [展示キャラクター一覧](#展示キャラクター一覧) を参照 | +| avatar | profilePicture | [アバターアイコン](#アバターアイコン) を参照 | -### Avatar icon +### アバターアイコン | ラッパー | API | 備考 | | ------- | -------- | ------------------------------------ | | id | avatarId | | -| icon | | Please refer [Icon Data](#icon-data) | +| icon | | [アイコン情報](#アイコン情報) を参照 | ### 名刺 @@ -202,129 +202,129 @@ Cache timeout: 300 | ------- | --- | ------------------------------------------------------------- | | id | - | 名刺ID | | name | - | 名刺の名前 | -| icon | - | 名刺アイコン, [Icon Data](#icon-data) を参照 | -| banner | - | 名刺のバナー, [Icon Data](#icon-data) を参照 | -| navbar | - | Namecard navbar (Alpha), Please refer [Icon Data](#icon-data) | +| icon | - | 名刺アイコン, [アイコン情報](#アイコン情報) を参照 | +| banner | - | 名刺のバナー, [アイコン情報](#アイコン情報) を参照 | +| navbar | - | 名刺(横長), [アイコン情報](#アイコン情報) を参照 | -### キャラクタープレビュー +### 展示キャラクター一覧 | ラッパー | API | 備考 | | ------- | --- | ------------------------------------------------- | | id | - | アバターID | | name | - | アバター名 | | level | - | アバターのレベル | -| icon | - | アバターアイコン, [Icon Data](#icon-data) を参照 | +| icon | - | アバターアイコン, [アイコン情報](#アイコン情報) を参照 | -## Characters +## キャラクター | ラッパー | API | 備考 | | ----------------------- | ---------------------- | ------------------------------------------------------ | | id | avatarId | | -| name | - | Avatar Name | -| element | - | Please refer [Element Type](#element-type) | -| rarity | - | Rarity | -| image | - | Please refer [Icon](#icon) | +| name | - | アバター名 | +| element | - | [Element Type](#element-type) を参照 | +| rarity | - | レア度 | +| image | - | [アイコン](#アイコン) を参照 | | xp | propMap -> 1001 | | | ascension | propMap -> 1002 | | | level | propMap -> 4001 | | | max_level | - | Avatar max level (Like 50/60) | | friendship_level | fetterInfo.level | | -| equipments | equipList | Please refer [Equipments](#equipments-artifact-weapon) | -| stats | fightPropMap | Please refer [FIGHT_PROP Data](#fight_prop-data) | -| constellations | talentIdList | Please refer [Constellation](#constellation) | -| constellations_unlocked | - | Constellation unlocked | +| equipments | equipList | [装備](#装備-聖遺物-武器) を参照 | +| stats | fightPropMap | [FIGHT_PROPデータ](#fight_propデータ) を参照 | +| constellations | talentIdList | [命ノ星座](#命ノ星座) を参照 | +| constellations_unlocked | - | 解放済みの命ノ星座 | | skill_data | inherentProudSkillList | | | skill_id | skillDepotId | | -| skills | - | Please refer [Skill](#skill) | +| skills | - | [スキル](#スキル) を参照 | -### Icon +### アイコン | ラッパー | API | 備考 | | ------- | --- | -------------------------------------------------------- | -| icon | - | Avatar icon, Please refer [Icon Data](#icon-data) | -| side | - | Avatar side icon, Please refer [Icon Data](#icon-data) | -| banner | - | Avatar wish banner, Please refer [Icon Data](#icon-data) | +| icon | - | アバターアイコン, [アイコン情報](#アイコン情報) を参照 | +| side | - | アバターの横向きアイコン, [アイコン情報](#アイコン情報) を参照 | +| banner | - | アバターの祈願バナー, [アイコン情報](#アイコン情報) を参照 | -### Constellation +### 命ノ星座 | ラッパー | API | 備考 | | -------- | --- | -------------------------- | -| id | - | Constellation ID | -| name | - | Constellation Name | -| icon | - | Constellation Icon (URL) | -| unlocked | - | Constellation has unlocked | +| id | - | 命ノ星座ID | +| name | - | 命ノ星座の名前 | +| icon | - | 命ノ星座のアイコンURL | +| unlocked | - | 命ノ星座の開放状態 | -### Skill +### スキル | ラッパー | API | 備考 | | ---------- | --- | ----------------------- | -| id | - | Skill ID | -| name | - | Skill Name | -| icon | - | Skill Icon (URL) | -| level | - | Skill Level | -| is_boosted | - | Skill level has boosted | +| id | - | スキルID | +| name | - | スキル名 | +| icon | - | スキルのアイコンURL | +| level | - | スキルレベル | +| is_boosted | - | スキルレベルの増加状態 | -## Equipments (Artifact, Weapon) +## 装備 (聖遺物, 武器) | ラッパー | API | 備考 | | ---------- | ----------------------------------- | ------------------------------------------------ | | id | itemId | | | level | reliquary -> level, weapon -> level | -| type | - | Type of equipment (Artifact or Weapon) | +| type | - | 装備タイプ (聖遺物または武器) | | refinement | weapon -> affixMap | | | ascension | weapon -> promoteLevel | | -| detail | flat | Please refer [Equipments Info](#equipments-info) | +| detail | flat | [装備情報](#装備情報) を参照 | -### Equipments Info +### 装備情報 | ラッパー | API | 備考 | | ------------- | ----------------------------------- | -------------------------------------------------- | -| name | - | Equipment Name (Artifact name or Weapon name) | -| icon | icon | Please refer [Icon Data](#icon-data) | -| artifact_type | - | Please refer [Artifact Type](#artifact-type) | +| name | - | 装備の名前 (聖遺物名 または 武器名) | +| icon | icon | [アイコン情報](#アイコン情報) を参照 | +| artifact_type | - | [装備タイプ](#装備タイプ) を参照 | | rarity | rankLevel | | -| mainstats | reliquaryMainstat, weaponStats -> 0 | Please refer [Equipments Stats](#equipments-stats) | -| substats | reliquarySubstats, weaponStats -> 1 | Please refer [Equipments Stats](#equipments-stats) | +| mainstats | reliquaryMainstat, weaponStats -> 0 | [装備ステータス](#装備ステータス) を参照 | +| substats | reliquarySubstats, weaponStats -> 1 | [装備ステータス](#装備ステータス) を参照 | -### Equipments Stats +### 装備ステータス | ラッパー | API | 備考 | | ------- | ------- | ------------------------------ | | prop_id | prop_id | | -| type | - | Value type (NUMBER or PERCENT) | -| name | - | Name of FIGHT_PROP | +| type | - | 値のタイプ (整数 または パーセント) | +| name | - | FIGHT_PROPの名前 | | value | value | | -## FIGHT_PROP Data +## FIGHT_PROPデータ -In FIGHT_PROP data. You can get the value from 4 methods. -| Choice | Example | Output | +FIGHT_PROPデータでは4つのメソッドから値を取得できます。 +| 選択 | 例 | 戻り値 | |------------------|---------------------------|----------------------------| -| Get raw value | stats.FIGHT_PROP_HP.value | 15552.306640625 | -| Get rounded value| stats.FIGHT_PROP_ATTACK.to_rounded() | 344 | -| Get percentage | stats.FIGHT_PROP_FIRE_ADD_HURT.to_percentage() | 61.5 | -| Get percentage and symbol | stats.FIGHT_PROP_FIRE_ADD_HURT.to_percentage_symbol() | 61.5% | +| 生のデータを取得 | stats.FIGHT_PROP_HP.value | 15552.306640625 | +| 丸め込んだ数値の取得 | stats.FIGHT_PROP_ATTACK.to_rounded() | 344 | +| パーセントの数値の取得 | stats.FIGHT_PROP_FIRE_ADD_HURT.to_percentage() | 61.5 | +| %付きの数値の取得 | stats.FIGHT_PROP_FIRE_ADD_HURT.to_percentage_symbol() | 61.5% | -## Build +## ビルド -In this `Builds` It's not pretty data. You can use this method to get data. Or if you want get full, You can use `raw` argument -| Choice | Example | Output | +`ビルド`のデータは整形されていません。以下のメソッドからデータを取得できます。また、`raw`引数を使うことで完全なデータを得られます。 +| 選択 | 例 | 戻り値 | |------------------|---------------------------|----------------------------| -| Get avatar ID list | builds.get_avatar_list() | [10000021,10000037,10000025, ...] | -| Get character build | builds.get_character(10000021) | List of [Build info](#avatar-builds-info) | -| Get build info by avatar id | builds.get_character(10000021, 11111111) | [Build info](#avatar-builds-info) | +| アバターIDのリストを取得 | builds.get_avatar_list() | [10000021,10000037,10000025, ...] | +| キャラクターのビルドを取得 | builds.get_character(10000021) | List of [ビルド情報](#ビルド情報) | +| アバターIDでビルド情報を取得 | builds.get_character(10000021, 11111111) | [ビルド情報](#ビルド情報) | -# Icon Data +# アイコン情報 -In icon data. You can get the value from 2 methods. -| Choice | Example | Output | +アイコン情報では2つのメソッドから値を取得できます。 +| 選択 | 例 | 戻り値 | |------------------|---------------------------|--------------------------------| -| Get filename | icon.filename | UI_AvatarIcon_Kazuha_Card.png | -| Get URL | icon.url | https://enka.network/ui/UI_AvatarIcon_Kazuha_Card.png | +| ファイル名の取得 | icon.filename | UI_AvatarIcon_Kazuha_Card.png | +| URLの取得 | icon.url | https://enka.network/ui/UI_AvatarIcon_Kazuha_Card.png | -## Artifact Type +## 装備タイプ -| Key | Value | +| キー | 値 | | ------- | -------------- | | Flower | EQUIP_BRACER | | Feather | EQUIP_NECKLACE | @@ -332,9 +332,9 @@ In icon data. You can get the value from 2 methods. | Goblet | EQUIP_RING | | Circlet | EQUIP_DRESS | -## Element Type +## 元素タイプ -| Key | Value | +| キー | 値 | | ------- | -------- | | Cryo | Ice | | Hydro | Water | @@ -343,11 +343,11 @@ In icon data. You can get the value from 2 methods. | Geo | Rock | | Electro | Electric | -# Assets +# アセット -## Assets character, constellations, skills, namecards +## キャラクター, 命ノ星座, スキル, 名刺 -You can use avatarId to get the character, constellations, skills, namecards from assets. +アバターID(avatarId)でキャラクター、命ノ星座、スキル、名刺のアセットを取得できます。 ```py import asyncio @@ -370,9 +370,9 @@ loop = asyncio.get_event_loop() loop.run_until_complete(main()) ``` -## Assets NameTextMapHash +## NameTextMapHash -The `NameTextMapHash` is a hash map that contains the name text of the assets. You can get `NameTextMapHash` from `hash_id` like this: +`NameTextMapHash`はアセット名のテキストが入ったハッシュマップです。`hash_id`から`NameTextMapHash`を以下のように取得できます。 ```py import asyncio @@ -392,7 +392,7 @@ loop.run_until_complete(main()) ## 言語のサポート -| Languege | Code | +| 言語 | コード | | ---------- | ---- | | English | en | | русский | ru | @@ -409,13 +409,13 @@ loop.run_until_complete(main()) | Taiwan | cht | | Chinese | chs | -If you want full docs for the API, visit [EnkaNetwork API Docs](https://github.com/EnkaNetwork/API-docs) +APIの完全なドキュメントが必要な場合は[EnkaNetwork API Docs](https://github.com/EnkaNetwork/API-docs)を参照してください。 -## Support & Question +## サポートと質問 -If you need support or some question about EnkaNetwokt.py. You can feel free contact to me in [Enka.network discord server](https://discord.gg/G3m7CWkssY) in [𝖯𝖸┃enkanetwork․py](https://discord.com/channels/840335525621268520/1046281445049647104) channel and mention (Ping) to **@M-307** for support and help +Enkanetwork.pyについてサポートや質問がある場合は[Enka.network discordサーバー](https://discord.gg/G3m7CWkssY)の[𝖯𝖸┃enkanetwork․py](https://discord.com/channels/840335525621268520/1046281445049647104)で **@M-307** へメンションしてください。 -# LICENSE +# ライセンス [MIT License](./LICENSE) From 5019ced29c84e398a6c373a17c57093526c81f9f Mon Sep 17 00:00:00 2001 From: "user.email" <0kq@0kqnet.work> Date: Mon, 10 Jul 2023 11:06:26 +0900 Subject: [PATCH 4/8] update README_JP.md --- README_JP.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README_JP.md b/README_JP.md index c86aa62..1ba362f 100644 --- a/README_JP.md +++ b/README_JP.md @@ -19,7 +19,7 @@ https://enka.network/ のAPIラッパーライブラリ - [Hoyosプロフィール](#Hoyosプロフィール) - [ビルド情報](#ビルド情報) - [プロフィール情報](#プロフィール情報) - - [Player](#プレイヤー) + - [プレイヤー](#プレイヤー) - [名刺](#名刺) - [アバターアイコン](#アバターアイコン) - [展示キャラクター一覧](#展示キャラクター一覧) @@ -221,13 +221,13 @@ Cache timeout: 300 | ----------------------- | ---------------------- | ------------------------------------------------------ | | id | avatarId | | | name | - | アバター名 | -| element | - | [Element Type](#element-type) を参照 | +| element | - | [元素タイプ](#元素タイプ) を参照 | | rarity | - | レア度 | | image | - | [アイコン](#アイコン) を参照 | | xp | propMap -> 1001 | | | ascension | propMap -> 1002 | | | level | propMap -> 4001 | | -| max_level | - | Avatar max level (Like 50/60) | +| max_level | - | アバターの最大レベル ( 50/60 等) | | friendship_level | fetterInfo.level | | | equipments | equipList | [装備](#装備-聖遺物-武器) を参照 | | stats | fightPropMap | [FIGHT_PROPデータ](#fight_propデータ) を参照 | From c54756494088ad2c78c63ef345a8baea24b87c0e Mon Sep 17 00:00:00 2001 From: "user.email" <0kq@0kqnet.work> Date: Mon, 10 Jul 2023 11:11:58 +0900 Subject: [PATCH 5/8] update README_JP.md --- README_JP.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README_JP.md b/README_JP.md index 1ba362f..18881a1 100644 --- a/README_JP.md +++ b/README_JP.md @@ -311,7 +311,7 @@ FIGHT_PROPデータでは4つのメソッドから値を取得できます。 | 選択 | 例 | 戻り値 | |------------------|---------------------------|----------------------------| | アバターIDのリストを取得 | builds.get_avatar_list() | [10000021,10000037,10000025, ...] | -| キャラクターのビルドを取得 | builds.get_character(10000021) | List of [ビルド情報](#ビルド情報) | +| キャラクターのビルドを取得 | builds.get_character(10000021) | [ビルド情報](#ビルド情報)のリスト | | アバターIDでビルド情報を取得 | builds.get_character(10000021, 11111111) | [ビルド情報](#ビルド情報) | # アイコン情報 From 92b9e7d1720c03560c8e60781277c471ea95c3a0 Mon Sep 17 00:00:00 2001 From: "user.email" <0kq@0kqnet.work> Date: Tue, 11 Jul 2023 10:58:40 +0900 Subject: [PATCH 6/8] fix value type --- enkanetwork/model/assets.py | 10 +++++----- enkanetwork/model/equipments.py | 2 +- enkanetwork/model/players.py | 2 +- requirements.txt | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/enkanetwork/model/assets.py b/enkanetwork/model/assets.py index 06cf0b8..e42064d 100644 --- a/enkanetwork/model/assets.py +++ b/enkanetwork/model/assets.py @@ -32,7 +32,7 @@ class NamecardAsset(BaseModel): """ id: int = 0 - hash_id: str = Field("", alias="nameTextMapHash") + hash_id: str | int = Field("", alias="nameTextMapHash") icon: IconAsset banner: IconAsset navbar: IconAsset @@ -74,7 +74,7 @@ class CharacterSkillAsset(BaseModel): """ id: int = 0, pround_map: int = 0, - hash_id: str = Field("", alias="nameTextMapHash") + hash_id: str | int = Field("", alias="nameTextMapHash") icon: IconAsset = None @@ -91,7 +91,7 @@ class CharacterConstellationsAsset(BaseModel): A icon assets. Please refers in `IconAsset` class """ id: int = 0 - hash_id: str = Field("", alias="nameTextMapHash") + hash_id: str | int = Field("", alias="nameTextMapHash") icon: IconAsset = None @@ -114,7 +114,7 @@ class AritfactProps(BaseModel): id: int = 0 type: str = Field('', alias='propType') digit: str = Field('DIGIT', alias='propDigit') - value: int = Field(0, alias='propValue') + value: int | float = Field(0, alias='propValue') class CharacterAsset(BaseModel): @@ -141,7 +141,7 @@ class CharacterAsset(BaseModel): """ id: int = 0 rarity: int = 0 - hash_id: str = Field("", alias="nameTextMapHash") + hash_id: str | int = Field("", alias="nameTextMapHash") element: ElementType = ElementType.Unknown images: CharacterIconAsset = None skill_id: int = 0 diff --git a/enkanetwork/model/equipments.py b/enkanetwork/model/equipments.py index 908c690..6a8ac11 100644 --- a/enkanetwork/model/equipments.py +++ b/enkanetwork/model/equipments.py @@ -93,7 +93,7 @@ class EquipmentsProps(BaseModel): prop_id: str = '' name: str = '' digit: DigitType = DigitType.NUMBER - value: int = 0 + value: int | float = 0 def __init__(self, **data: Any) -> None: super().__init__(**data) diff --git a/enkanetwork/model/players.py b/enkanetwork/model/players.py index 9e1ac43..032536f 100644 --- a/enkanetwork/model/players.py +++ b/enkanetwork/model/players.py @@ -50,7 +50,7 @@ class showAvatar(BaseModel): """ API Response data """ - id: str = Field(0, alias="avatarId") + id: int = Field(0, alias="avatarId") level: int = 1 """ diff --git a/requirements.txt b/requirements.txt index 343bef1..20db950 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ -pydantic +pydantic >= 2.0.0 aiohttp cachetools \ No newline at end of file From 9c82f65545272be2b45c08d8a536e063bc1d1686 Mon Sep 17 00:00:00 2001 From: "user.email" <0kq@0kqnet.work> Date: Wed, 12 Jul 2023 08:47:06 +0900 Subject: [PATCH 7/8] Revert "fix value type" This reverts commit 92b9e7d1720c03560c8e60781277c471ea95c3a0. --- enkanetwork/model/assets.py | 10 +++++----- enkanetwork/model/equipments.py | 2 +- enkanetwork/model/players.py | 2 +- requirements.txt | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/enkanetwork/model/assets.py b/enkanetwork/model/assets.py index e42064d..06cf0b8 100644 --- a/enkanetwork/model/assets.py +++ b/enkanetwork/model/assets.py @@ -32,7 +32,7 @@ class NamecardAsset(BaseModel): """ id: int = 0 - hash_id: str | int = Field("", alias="nameTextMapHash") + hash_id: str = Field("", alias="nameTextMapHash") icon: IconAsset banner: IconAsset navbar: IconAsset @@ -74,7 +74,7 @@ class CharacterSkillAsset(BaseModel): """ id: int = 0, pround_map: int = 0, - hash_id: str | int = Field("", alias="nameTextMapHash") + hash_id: str = Field("", alias="nameTextMapHash") icon: IconAsset = None @@ -91,7 +91,7 @@ class CharacterConstellationsAsset(BaseModel): A icon assets. Please refers in `IconAsset` class """ id: int = 0 - hash_id: str | int = Field("", alias="nameTextMapHash") + hash_id: str = Field("", alias="nameTextMapHash") icon: IconAsset = None @@ -114,7 +114,7 @@ class AritfactProps(BaseModel): id: int = 0 type: str = Field('', alias='propType') digit: str = Field('DIGIT', alias='propDigit') - value: int | float = Field(0, alias='propValue') + value: int = Field(0, alias='propValue') class CharacterAsset(BaseModel): @@ -141,7 +141,7 @@ class CharacterAsset(BaseModel): """ id: int = 0 rarity: int = 0 - hash_id: str | int = Field("", alias="nameTextMapHash") + hash_id: str = Field("", alias="nameTextMapHash") element: ElementType = ElementType.Unknown images: CharacterIconAsset = None skill_id: int = 0 diff --git a/enkanetwork/model/equipments.py b/enkanetwork/model/equipments.py index 6a8ac11..908c690 100644 --- a/enkanetwork/model/equipments.py +++ b/enkanetwork/model/equipments.py @@ -93,7 +93,7 @@ class EquipmentsProps(BaseModel): prop_id: str = '' name: str = '' digit: DigitType = DigitType.NUMBER - value: int | float = 0 + value: int = 0 def __init__(self, **data: Any) -> None: super().__init__(**data) diff --git a/enkanetwork/model/players.py b/enkanetwork/model/players.py index 032536f..9e1ac43 100644 --- a/enkanetwork/model/players.py +++ b/enkanetwork/model/players.py @@ -50,7 +50,7 @@ class showAvatar(BaseModel): """ API Response data """ - id: int = Field(0, alias="avatarId") + id: str = Field(0, alias="avatarId") level: int = 1 """ diff --git a/requirements.txt b/requirements.txt index 20db950..343bef1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ -pydantic >= 2.0.0 +pydantic aiohttp cachetools \ No newline at end of file From c16f181e34a62db95e05d62c0a7a82f1ecbe8465 Mon Sep 17 00:00:00 2001 From: "user.email" <0kq@0kqnet.work> Date: Thu, 13 Jul 2023 09:12:53 +0900 Subject: [PATCH 8/8] fix lang code (jp -> ja) --- README.md | 2 +- README_JP.md => README_JA.md | 2 +- README_TH.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename README_JP.md => README_JA.md (99%) diff --git a/README.md b/README.md index 8cd9c2c..5317984 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Enka Network Python -EN | [TH](https://github.com/mrwan200/EnkaNetwork.py/blob/master/README_TH.md) | [JP](https://github.com/mrwan200/EnkaNetwork.py/blob/master/README_JP.md) +EN | [TH](https://github.com/mrwan200/EnkaNetwork.py/blob/master/README_TH.md) | [JA](https://github.com/mrwan200/EnkaNetwork.py/blob/master/README_JA.md) Library for API wrapper data from site https://enka.network/ diff --git a/README_JP.md b/README_JA.md similarity index 99% rename from README_JP.md rename to README_JA.md index 18881a1..8d3b3b3 100644 --- a/README_JP.md +++ b/README_JA.md @@ -1,6 +1,6 @@ # Enka Network Python -[EN](./README.md) | [TH](./README_TH.md) | JP +[EN](./README.md) | [TH](./README_TH.md) | JA https://enka.network/ のAPIラッパーライブラリ diff --git a/README_TH.md b/README_TH.md index 3e76c49..fced8d4 100644 --- a/README_TH.md +++ b/README_TH.md @@ -1,5 +1,5 @@ # Enka Network Python -[EN](./README.md) | TH | [JP](./README_JP.md) +[EN](./README.md) | TH | [JA](./README_JA.md) ไลบารีสำหรับดึงข้อมูล JSON จากเว็บ https://enka.network