Skip to main content

Terraria world parser in Python

Project description

Lihzahrd

Terraria game world parser for Python.

Links

Available on PyPI

Full documentation

Installation

Lihzahrd can be installed from PyPI like any other public Python package.

Using uv, that means:

uv add 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.

[!Warning]

Maliciously designed Terraria worlds can drain system resources, crash the interpreter, or possibly do other evil things!

Make sure you trust worlds before parsing them!

Documentation

The documentation is available here.

If you know something that is missing in the documentation, please let me know with an issue!

PyPy

lihzahrd is compatible with PyPy, an alternative implementation on Python!

If you think that parsing a world takes too much time, you can use PyPy to reduce the required time by a factor of ~3!

Benchmarks

Time to parse the same large world:

  • CPython took 11.45 s.
  • Pypy took 3.57 s!

Building docs

You can build the docs by entering the docs_source folder and running make html, then committing the whole docs folder.

References used

See also

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lihzahrd-3.1.1.tar.gz (8.1 MB view hashes)

Uploaded Source

Built Distribution

lihzahrd-3.1.1-py3-none-any.whl (111.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page