A simple Python Pydantic model for Honkai: Star Rail parsed data from the Mihomo API.
A simple Python Pydantic model for Honkai: Star Rail parsed data from the Mihomo API.
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}
pip install -U git+https://github.com/KT-Yeh/mihomo.gitThere are two parsed data formats:
client.fetch_user_v1(800333171)mihomo.models.v1.StarrailInfoParsedV1mihomo/models/v1 directory.client.fetch_user(800333171)mihomo.models.StarrailInfoParsedmihomo/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.
…from mihomo import tools
data = await client.fetch_user(800333171)
data = tools.remove_duplicate_character(data) 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)Take pickle and json as an example
import pickle
import zlib
from mihomo import MihomoAPI, Language, StarrailInfoParsed
client = MihomoAPI(language=Language.EN)
data = await client.fetch_user(800333171)
# Save
pickle_data = zlib.compress(pickle.dumps(data))
print(len(pickle_data))
json_data = data.json(by_alias=True, ensure_ascii=False)
print(len(json_data))
# Load
data_from_pickle = pickle.loads(zlib.decompress(pickle_data))
data_from_json = StarrailInfoParsed.parse_raw(json_data)
print(type(data_from_pickle))
print(type(data_from_json))[Bug] hysteria2的 realm-opts配置下stun-servers任何一个无效时连接失败
[Feature] 遇到看央视频电视直播卡顿 无法正常播放
WireGuard outbound: config reload (PUT /configs) leaves the old device running — two sockets with one key, the peer's endpoint flaps
[Feature] Support mimic option for hysteria2
[Bug] REJECT outbound silently drops UDP packets (nopPacketConn) instead of rejecting, behaving identically to REJECT-DROP
[Feature] Windows上的严格路由能否加强
[Feature] hosts 域名映射支持用于 DNS 上游连接解析
[Feature] wireguard listeners
[Feature] Windows TUN: 检测物理出口 forwarding 并熔断 WSL mirrored self-reentry
[Feature] Naive Proxy 支持