HonkaiRail
A simple and convenient model for Mihoyo API which is complemented by other resources
Install:
pip install honkairail
Uses:
from honkairail import starrailapi
import asyncio
#The sample code below matches version 1 (v = 1), but you can set it to 1 or 2. The second version is newer and contains a bit more data.
async def main(uid,lang):
r = starrailapi.StarRailApi(lang, v = 2)
data = await r.get_full_data(uid)
print(data)
asyncio.run(main(700649319,"en"))
Usage example:
from honkairail import starrailapi
import asyncio
async def main(uid,lang):
r = starrailapi.StarRailApi(lang)
data = await r.get_full_data(uid)
print("====Player====")
print(f"Name: {data.player.name}")
print(f"UID: {data.player.uid}")
print(f"Level: {data.player.level}")
print(f"World Level: {data.player.worldlevel}")
print(f"Friends: {data.player.friends}")
print(f"Pass Area Progress: {data.player.pass_area_progress}")
print(f"Achievement: {data.player.achievement}")
print(f"Characters: {data.player.characters}")
print(f"Light Cone: {data.player.light_cone}")
print(f"Icon: {data.player.icon}")
print(f"Signature: {data.player.signature}")
print('\n\n')
print("====Characters====")
for character in data.characters:
print(f"Name: {character.name} | {character.id}")
print(f"Rarity: {'★'*character.rarity}")
print(f"LVL: {character.level}")
print(f"===={character.rank_text}====")
for rank in character.rank_icons:
print(f"Icon: {rank.icon}\nUnlock: {rank.unlock}")
print("====Skill====")
for skill in character.skill:
print(f"Icon: {skill.icon}\nLVL:{skill.level}")
print("=============")
if not character.light_cone is None:
print(f"Light Cone: {character.light_cone.name}")
print(f"Rarity: {'★'*character.light_cone.rarity}")
print(f"LVL: {character.light_cone.level} | R{character.light_cone.rank}")
print(f"Icon: {character.light_cone.icon}")
print(f"Portrait: {character.light_cone.portrait}")
light_cone = await r.get_light_cone_info(character.light_cone)
print(f"ATK: {light_cone.atk} | HP: {light_cone.hp} | DEF: {light_cone.defense}")
print(f"Path: {light_cone.patch.name}\nImage: {light_cone.patch.url}")
print("====Stats====")
for property in character.property:
if property.addition is None:
print(f"{property.name}: {property.base}\nIcon: {property.icon}")
else:
print(f"{property.name}: {property.base} ({property.addition})\n==Icon: {property.icon}")
print('\n\n')
print("====Relic====")
for i in character.relic:
print(f"{character.relic[i].name}: {character.relic[i].level} lvl | {'★'*character.relic[i].rarity}")
print(f"{character.relic[i].main_property.name}: {character.relic[i].main_property.value}")
for sub_property in character.relic[i].sub_property:
print(f"=={sub_property.name}: {sub_property.value}\n====Icon: {sub_property.icon}")
print('\n')
print("\n\n")
asyncio.run(main(700649319, "en"))
Languages Supported
| Languege | Code | Languege | Code | Languege | Code |
|---|---|---|---|---|---|
| English | en | русский | ru | Chinese | chs |
| Tiếng Việt | vi | ไทย | th | Taiwan | cn |
| português | pt | 한국어 | kr | deutsch | de |
| 日本語 | jp | 中文 | zh | español | es |
| 中文 | zh | Indonesian | id | français | fr |
| Український | ua |
Metadata
Release files for honkairail 1.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| honkairail-1.1.4.tar.gz | 6.0 kB | Without provenance | Details for honkairail-1.1.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| honkairail-1.1.4-py3-none-any.whl | Python 3 | none | any | Details for honkairail-1.1.4-py3-none-any.whl |
Total release size: 14.2 kB
Release files / honkairail-1.1.4.tar.gz
| Download URL | honkairail-1.1.4.tar.gz |
|---|---|
| Size | 6.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
348f5ba04884e1c6daccc37d71a8122c66539c700278ad28036e11a88fe91882
|
|
BLAKE2b-256 checksum How to use checksums |
255f6fb061bafd284c80228d64f9ed26378057a3356f062b0a0503c17e03d623
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.6.1 CPython/3.11.5 Windows/10
|
Release files / honkairail-1.1.4-py3-none-any.whl
| Download URL | honkairail-1.1.4-py3-none-any.whl |
|---|---|
| Size | 8.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
84b170cebd88e926bb8673b5f0bb3575f4bb7febb158a2369e74c8c3c451b551
|
|
BLAKE2b-256 checksum How to use checksums |
a7a1d8433fe867a8ba209c0bf68be5f3cf41a162a59ae6c8436760fc90d02926
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.6.1 CPython/3.11.5 Windows/10
|
Security for honkairail 1.1.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.