d2animdata, a Python script for editing AnimData.D2

This would be the forum for questions about how to work with mod making tools which can be a problem of its own.

Moderator: Paul Siramy

Post Reply
User avatar
mmpx222
Junior Member
Paladin
Posts: 152
Joined: Sat Apr 26, 2014 9:19 am
Korea South

d2animdata, a Python script for editing AnimData.D2

Post by mmpx222 » Sat Mar 14, 2020 5:51 am

I wrote a small Python script named d2animdata. It decompiles AnimData.D2 to tabbed text (TXT) and back. It is available on PyPI, so you can install it using

Code: Select all

pip install d2animdata
like any other Python package.

It is similar to Paul Siramy's animdata_edit, but offers some additional features:
  • d2animdata will perform strict checks on AnimData.D2 and catch possible errors early.
  • Can also decompile to JSON and back. JSON is more suited for a text editor, and produces better Git diff logs.
  • Sorting entries is optional (via the --sort option)
  • It is also a library, so you can import d2animdata in your own Python script to programmatically edit AnimData.D2.
  • Cross-platform
d2animdata requires Python 3.6 or above.

Note: I'm thinking of adding support for more human-friendly formats (e.g. JSON5, YAML, TOML). Not sure if it's worth it.

Feedback is welcome!
D2TXT / D2INI - Python scripts for editing TXT files, or converting between TXT ↔ INI files

Post Reply

Return to “Tools”