mihomo provides typed Python models and a small client for fetching and parsing Honkai: Star Rail player data from the public Mihomo API.
Overview
The package wraps parsed Honkai: Star Rail profile data in Pydantic models so editors get type hints and autocompletion. It is aimed at developers building tools that consume the Mihomo HTTP API rather than end users playing the game.
Two parsed formats are supported. V1 data is retrieved with fetch_user_v1 and modeled under mihomo.models.v1; V2 uses fetch_user with models in mihomo.models. Callers can request V2 responses with icon names already replaced by asset URLs to avoid extra lookup steps.
Helper utilities under mihomo.tools cover tasks such as deduplicating characters and merging character records. Fetched structures can be persisted via pickle or JSON for local processing pipelines.
Install the library with standard Python packaging from the published package name mihomo, then instantiate the client and pass a user identifier to retrieve structured Star Rail account information.
Key features
- Pydantic-typed API responses
- V1 and V2 parsed data layouts
- Client fetch helpers for users
- Optional inline asset URL replacement
- Character merge and dedupe tools
- Pickle and JSON persistence examples
- Modular model package layout
- Autocompletion-friendly type hints
Use cases
- Star Rail companion dashboards
- Account stat analysis scripts
- Caching parsed player profiles
- Building bots over Mihomo API data
- Teaching typed API clients in Python