MetaCubeX /mihomo
A simple Python Pydantic model for Honkai: Star Rail parsed data from the Mihomo API.
★ 35,792⑂ 4,777👁 149⑃ 792● 2,133▤ 66
+27
Daily
+171
Weekly
35,792
stars
4,777
forks
149
watchers
792
prs
2,133
issues
66
releases
README
mihomo
A simple python pydantic model (type hint and autocompletion support) for Honkai: Star Rail parsed data from the Mihomo API.
API url: https://api.mihomo.me/sr_info_parsed/{UID}?lang={LANG}
Installation
pip install -U git+https://github.com/KT-Yeh/mihomo.git
Usage
Basic
There are two parsed data formats:
- V1:
- URL: https://api.mihomo.me/sr_info_parsed/800333171?lang=en&version=v1
- Fetching: use client.fetch_user_v1(800333171)
- Data model: mihomo.models.v1.StarrailInfoParsedV1
- All models defined in mihomo/models/v1 directory.
- V2:
- URL: https://api.mihomo.me/sr_info_parsed/800333171?lang=en
- Fetching: use client.fetch_user(800333171)
- Data model: mihomo.models.StarrailInfoParsed
- All models defined in mihomo/models directory.
If you don't want to use client.get_icon_url to get the image url everytime, you can use client.fetch_user(800333171, replace_icon_name_with_url=True) to get the parsed data with asset urls.
Example
py
import asyncio
from mihomo import Language, MihomoAPI
from mihomo.models import StarrailInfoParsed
from mihomo.models.v1 import StarrailInfoParsedV1
client = MihomoAPI(language=Language.EN)
async def v1():
data: StarrailInfoParsedV1 = await client.fetch_user_v1(800333171)
print(f"Name: {data.player.name}")
print(f"Level: {data.player.level}")
print(f"Signature: {data.player.signature}")
print(f"Achievements: {data.player_details.achievements}")
print(f"Characters count: {data.player_details.characters}")
print(f"Profile picture url: {client.get_icon_url(data.player.icon)}")
for character in data.characters:
print("-----------")
print(f"Name: {character.name}")
print(f"Rarity: {character.rarity}")
print(f"Level: {character.level}")
print(f"Avatar url: {client.get_icon_url(character.icon)}")
print(f"Preview url: {client.get_icon_url(character.preview)}")
print(f"Portrait url: {client.get_icon_url(character.portrait)}")
async def v2():
data: StarrailInfoParsed = await client.fetch_user(800333171, replace_icon_name_with_url=True)
print(f"Name: {data.player.name}")
print(f"Level: {data.player.level}")
print(f"Signature: {data.player.signature}")
print(f"Profile picture url: {data.player.avatar.icon}")
for character in data.characters:
print("-----------")
print(f"Name: {character.name}")
print(f"Rarity: {character.rarity}")
print(f"Portrait url: {character.portrait}")
asyncio.run(v1())
asyncio.run(v2())
Tools
from mihomo import tools
Remove Duplicate Character
py
data = await client.fetch_user(800333171)
data = tools.remove_duplicate_character(data)
Merge Character Data
py
old_data = await client.fetch_user(800333171)
Change characters in game and wait for the API to refresh
...
new_data = await client.fetch_user(800333171)
data = tools.merge_character_data(new_data, old_data)
Data Persistence
TaTop issues
#1141[Feature] 关于龙架构二进制文件名的建议57 comments · 2024-03-28#1493[Bug] TUN模式下,DNAT入站流量无法回包出站的问题37 comments · 2024-09-03#865[Bug] wireguard无法连接,不知道是不是我的配置有问题35 comments · 2023-12-05#916[Feature] 可否考虑在DNS部分中加入redir-host与fake-ip混合模式29 comments · 2023-12-14#983[Bug] tun模式在Ubuntu18上生成的ip rule有误28 comments · 2024-01-15#982[Feature] 支持 Hysteria 2 的 port hopping 功能25 comments · 2024-01-15#1862[Feature] 关于 proxy-group 中引入 proxy-provider 的测速问题24 comments · 2025-02-25#702[建议]默认配置文件提供一个可用的版本18 comments · 2023-08-26
Discussions
#3465官方有Tailscale inbound支持计划吗0 comments · 2026-11-14#3417Mihomo, please resolve destination domains locally before forwarding to proxy outbounds0 comments · 2026-11-05#3399在不考虑DNS泄露问题的情况下,给DNS做分流是否有必要?1 comments · 2026-11-03#3393非 fake-ip 透明代理的情况下,规则中的 no-resolve 的行为2 comments · 2026-11-02#3392新版mihomo使用xhttp(自定义path)时节点无法连通,报错403 Forbidden/404 Not Found的解决办法1 comments · 2026-11-01#3391UDP 可以按 UID 分流吗?3 comments · 2026-11-01#3384Kilobat CLI: read-only per-app rule/node snapshots on macOS0 comments · 2026-10-30#3345macOS: default-interface monitor stays on removed USB tether after Wi-Fi handoff1 comments · 2026-10-20
Latest release
v1.19.34 v1.19.34 2026-11-11What's Changed 2d1a22e3 feat: support multiple users for shadowsocks listener (3383) by @Romanov Caesar f1f640b1 feat: add Snell version 6 support (outbound + inbound) (3410) by @YONG ff179c43 feat: add ss-password generation functionality to the command line tool (3372) by @Zephyruso BUG & Fix 478af2a5 fix: auto route rules for tun by @wwqgtxx 5b79f3c3 fix: tfo-go not working on go1.26.9+ and go1.27.2+ by @wwqgtxx 6780eeeb fix: prevent SOCKS domain length arithmetic overflow (3359) by @SaladDay 69c16319 fix: keep bytes that arrive with the HTTP proxy's CONNECT response (3382) by @Gti