This script was created to decompress SVG-encoded files from Path of Building (PoE2). The main goal is to transform the data into something understandable to any algorithm, AI, or learning model. However, you are free to use it as you want!
This Python script performs the following tasks:
- Reads a base64-encoded and zlib-compressed SVG string from a file
- Decodes and decompresses the string to retrieve an XML representation
- Parses the XML structure and extracts meaningful game data
- Removes null values and structures the extracted information
- Saves the results as a JSON file for further processing
The extracted data includes player information, stats, passive tree nodes, skills, and items.
- Reads compressed and base64-encoded SVG data from a file
- Decodes and decompresses it using multiple methods for robustness
- Parses the XML structure to extract:
- Player Info (Level, Class, Ascendancy)
- Player Stats
- Passive Skill Tree
- Skills & Gems
- Items & Equipment
- Cleans the data by removing null values
- Saves the structured data into a JSON file
Ensure you have Python 3 installed, then clone the repository and navigate to the project directory.
- Place the base64-encoded compressed SVG data inside a file (default name is build.txt).
- Run the script.
- The script will:
- Decompress and parse the SVG content
- Extract relevant game data
- Save the structured output to a JSON file
This script only uses built-in Python libraries, ensuring maximum compatibility. No additional installations are required.
Used libraries :
- base64
- zlib
- json
- xml.etree.ElementTree
- Recursively removes
None
values from a dictionary or list. - Decodes and decompresses base64-encoded SVG data using multiple methods.
- Extracts player level, class, ascendancy, stats, passive skill tree, skills, and items from the XML structure.
- Saves the extracted data into a structured JSON file.
This project is licensed under the MIT License - see the LICENSE file for details.
Pull requests are welcome. If you have major changes, please open an issue first to discuss them.
For any questions or suggestions, feel free to reach out or open an issue on GitHub.
Creator: Axel Bouchaud--Roche