A package for parsing type tree packages (TPK)
Maintained. Last release 4 months ago, commits in 2 of the last 26 weeks. Weaker on commit activity and release cadence.
pip install tpk-artpk_ar
A Python port of AssetRipper/Tpk, primarily for use in UnityPy.
This is maintained as a separate project to ensure forward compatibility for older UnityPy versions against potential breaking changes in the original code.
Rather than acting as an exact mirror of the upstream project, this port focuses solely on providing a Tpk format parser with a stable, backward-compatible API.
Options
The brotli and lz4 dependencies are optional. To handle compressed Tpk files, install the package with the required extras:
pip install "tpk_ar[brotli]"
pip install "tpk_ar[lz4]"
pip install "tpk_ar[full]" # Installs both
Development
TODO
- Parser
- Dumper (for saving extracted type tree information of games)
- Native Extension (C++, for performance)
Benchmarking
To measure the cost of loading a TPK file and inspect the same code path in snakeviz, install the dev extras:
uv sync --extra dev
Run the timing benchmark against the bundled uncompressed sample:
uv run python benchmarks/bench_load.py
Generate a profile for the same load path, then open it in snakeviz:
uv run python benchmarks/profile_load.py
uv run snakeviz profiles/uncompressed.prof