Skip to content

This Python script decompresses a base64-encoded and zlib-compressed SVG file. It reads the encoded data from a .txt file, decodes and decompresses it, and then saves the resulting XML content into a .json file.

License

Notifications You must be signed in to change notification settings

AxelBcr/PoB-SVG-Decompressor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SVG Decompressor

Special Note

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!

Overview

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.

Features

  • 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

Installation

Ensure you have Python 3 installed, then clone the repository and navigate to the project directory.

Usage

  1. Place the base64-encoded compressed SVG data inside a file (default name is build.txt).
  2. Run the script.
  3. The script will:
    • Decompress and parse the SVG content
    • Extract relevant game data
    • Save the structured output to a JSON file

Dependencies

This script only uses built-in Python libraries, ensuring maximum compatibility. No additional installations are required.

Used libraries :

  • base64
  • zlib
  • json
  • xml.etree.ElementTree

Code Explanation

  • 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.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contributing

Pull requests are welcome. If you have major changes, please open an issue first to discuss them.

Contact

For any questions or suggestions, feel free to reach out or open an issue on GitHub.
Creator: Axel Bouchaud--Roche

About

This Python script decompresses a base64-encoded and zlib-compressed SVG file. It reads the encoded data from a .txt file, decodes and decompresses it, and then saves the resulting XML content into a .json file.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages