2.3 KiB
lihzahrd
A Terraria 1.3.5.3 world parser in Python.
You can use this package to get programmer-friendly data from a Terraria world!
Install with:
pip install lihzahrd
Usage
You can open a world file and get a World
object by calling:
import lihzahrd
world = lihzahrd.World.create_from_file("filename.wld")
It will take a while to process: a small Terraria world contains more than 5 million tiles!
Once you have a World
object, you can use all data present in the save file by accessing its attributes.
Documentation
The documentation is available here.
It's a bit messy and incomplete, as I still have not figured out the meaning of some data, and the code is in need of some refactoring.
If you know something that isn't present in the documentation, please let me know with an issue!
References used
- The TEdit World Parser, the most accurate source currently available.
- The tModLoader wiki, containing lists of all possible IDs.
- The Terrafirma world documentation, accurate for old worlds (version <69)
- The 1.3.x.x world documentation, a bit incomplete, but an useful source nevertheless.
- A JS World Parser on GitHub.
- A Background Guide on Steam that displays all possible world backgrounds.
License
lihzahrd
is licensed under the AGPL 3.0.
That means you have to publish under the same license the source code of any program you create that uses lihzahrd
.
See also
- flyingsnake, a map renderer using this package