Contains single formatted JSON files detailing Honkai: Star Rail's light cone, relic, and character metadata. Formatted specifically for HSR-Scanner.
import requests
url = "https://raw.githubusercontent.com/kel-z/HSR-Data/main/output/game_data.json"
response = requests.get(url)
# Convert the response.content to a Python dictionary
data = response.json()
# Now `data` holds the contents of game_data.json
print(data)
This repo uses Mar-7th/StarRailRes as a submodule which contain the latest game resources. The main script in this repo refers and parses the necessary files from these submodules.
main.py parses the submodules and outputs the game data in a structured JSON format.
game_data.json includes:
-
Light Cones: A dictionary where each key is a light cone name and the value is another dictionary with a key
rarity
whose value is the rarity of the respective light cone. -
Relics: A dictionary with each key being a relic name and the value is a dictionary which holds information about the relic's
set
andslot
values. -
Characters: A dictionary where each key is a character name and the values are dictionaries that hold information about the character's eidolon level modifiers and how much
e3
ore5
increases the character'sbasic
,skill
,ult
, ortalent
level.
game_data_verbose.json contains more information about each item.
The code is structured to be run from the root directory with python src/main.py
, which outputs the processed game data JSON to the output/
directory.
Mini Icons (optional): Images are base64 encoded and stored as strings in this dictionary, where keys are image names and values are corresponding base64 encoded image strings. These images correspond to the tiny character portrait that appears next to an item's Equipped
tag in the inventory screen when an equipped item is selected.
However, these mini_icons must be added manually to the src/data/mini_icons
directory, as they cannot currently be created or fetched programmatically.
To generate the JSON file with the game data, perform the following steps:
- Ensure you have Python 3.6 or newer installed
- Clone this repository and ensure that you've also cloned the submodules properly
git clone --recursive https://github.com/kel-z/HSR-Data.git
- Ensure submodules are up-to-date
git submodule update --init --recursive --remote
- Navigate to the repository's root directory in your terminal
- Run
python src/main.py
The resulting game data JSONs will be located in the output/
directory.