Name | lihzahrd JSON |
Version |
3.1.1
JSON |
| download |
home_page | None |
Summary | Terraria world parser in Python |
upload_time | 2024-09-04 18:44:44 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.6.2 |
license | None |
keywords |
game
parser
terraria
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
<div align="center">
![](.media/icon-128x128_round.png)
# Lihzahrd
Terraria game world parser for Python.
</div>
## Links
[![Available on PyPI](https://img.shields.io/pypi/v/lihzahrd)](https://pypi.org/project/lihzahrd/)
[![Full documentation](https://img.shields.io/website?url=https%3A%2F%2Fgh.steffo.eu%2Flihzahrd%2Fhtml%2F&up_message=passing&down_message=failing&label=docs)](https://gh.steffo.eu/lihzahrd/html/)
## Installation
Lihzahrd can be installed from PyPI like any other public Python package.
Using [uv](https://docs.astral.sh/uv/), that means:
```shell
uv add lihzahrd
```
## Usage
You can open a world file and get a `World` object by calling:
```python
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](http://gh.steffo.eu/lihzahrd/html/world.html).
> [!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](https://gh.steffo.eu/lihzahrd/html/).
If you know something that is missing in the documentation, please let me know [with an issue](https://github.com/Steffo99/lihzahrd/issues/new)!
## PyPy
`lihzahrd` is compatible with [PyPy](https://www.pypy.org), 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
- The [TEdit World Parser](https://github.com/TEdit/Terraria-Map-Editor/blob/master/TEditXna/Terraria/World.FileV2.cs), the most accurate source currently available.
- The [tModLoader wiki](https://github.com/tModLoader/tModLoader/wiki), containing lists of all possible IDs.
- The [Terrafirma world documentation](http://seancode.com/terrafirma/world.html), accurate for old worlds (version <69)
- The [1.3.x.x world documentation](http://ludwig.schafer.free.fr/), a bit incomplete, but an useful source nevertheless.
- A [JS World Parser](https://github.com/cokolele/terraria-world-parser/) on GitHub.
- A [Background Guide](https://steamcommunity.com/sharedfiles/filedetails/?id=841032800) on Steam that displays all possible world backgrounds.
## See also
- [flyingsnake](https://github.com/Steffo99/flyingsnake), a map renderer using this package
Raw data
{
"_id": null,
"home_page": null,
"name": "lihzahrd",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6.2",
"maintainer_email": "Stefano Pigozzi <me@steffo.eu>",
"keywords": "game, parser, terraria",
"author": null,
"author_email": "Stefano Pigozzi <me@steffo.eu>",
"download_url": "https://files.pythonhosted.org/packages/47/59/a440d77f55d53f619200b2efedf3c606148549e58db69f371c1375817c26/lihzahrd-3.1.1.tar.gz",
"platform": null,
"description": "<div align=\"center\">\n\n![](.media/icon-128x128_round.png)\n\n# Lihzahrd\n\nTerraria game world parser for Python.\n\n</div>\n\n## Links\n\n[![Available on PyPI](https://img.shields.io/pypi/v/lihzahrd)](https://pypi.org/project/lihzahrd/)\n\n[![Full documentation](https://img.shields.io/website?url=https%3A%2F%2Fgh.steffo.eu%2Flihzahrd%2Fhtml%2F&up_message=passing&down_message=failing&label=docs)](https://gh.steffo.eu/lihzahrd/html/)\n\n## Installation\n\nLihzahrd can be installed from PyPI like any other public Python package.\n\nUsing [uv](https://docs.astral.sh/uv/), that means:\n\n```shell\nuv add lihzahrd\n```\n\n## Usage\n\nYou can open a world file and get a `World` object by calling:\n\n```python\nimport lihzahrd\nworld = lihzahrd.World.create_from_file(\"filename.wld\")\n```\n\nIt _will_ take a while to process: a small Terraria world contains more than 5 million tiles!\n\nOnce you have a `World` object, you can use all data present in the save file by accessing [its attributes](http://gh.steffo.eu/lihzahrd/html/world.html).\n\n> [!Warning]\n> \n> Maliciously designed Terraria worlds can drain system resources, crash the interpreter, or possibly do other evil things!\n> \n> **Make sure you trust worlds before parsing them!**\n\n## Documentation\n\nThe documentation is available [here](https://gh.steffo.eu/lihzahrd/html/).\n\nIf you know something that is missing in the documentation, please let me know [with an issue](https://github.com/Steffo99/lihzahrd/issues/new)!\n\n## PyPy\n\n`lihzahrd` is compatible with [PyPy](https://www.pypy.org), an alternative implementation on Python!\n\nIf you think that parsing a world takes too much time, you can use PyPy to reduce the required time by a factor of ~3!\n\n### Benchmarks\n\nTime to parse the same large world:\n\n- CPython took 11.45 s.\n- Pypy took 3.57 s!\n\n### Building docs\n\nYou can build the docs by entering the `docs_source` folder and running `make html`, then committing the whole `docs` folder.\n\n## References used\n\n- The [TEdit World Parser](https://github.com/TEdit/Terraria-Map-Editor/blob/master/TEditXna/Terraria/World.FileV2.cs), the most accurate source currently available.\n- The [tModLoader wiki](https://github.com/tModLoader/tModLoader/wiki), containing lists of all possible IDs.\n- The [Terrafirma world documentation](http://seancode.com/terrafirma/world.html), accurate for old worlds (version <69)\n- The [1.3.x.x world documentation](http://ludwig.schafer.free.fr/), a bit incomplete, but an useful source nevertheless.\n- A [JS World Parser](https://github.com/cokolele/terraria-world-parser/) on GitHub.\n- A [Background Guide](https://steamcommunity.com/sharedfiles/filedetails/?id=841032800) on Steam that displays all possible world backgrounds.\n\n## See also\n\n- [flyingsnake](https://github.com/Steffo99/flyingsnake), a map renderer using this package\n",
"bugtrack_url": null,
"license": null,
"summary": "Terraria world parser in Python",
"version": "3.1.1",
"project_urls": {
"Documentation": "https://gh.steffo.eu/lihzahrd/",
"Repository": "https://forge.steffo.eu/steffo/lihzahrd/"
},
"split_keywords": [
"game",
" parser",
" terraria"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "4d93741a7d6be448734b698849e26b9726042d5cae5b4363729118578a3b90b8",
"md5": "4b8a7d859a1994ce879471cbc350a324",
"sha256": "aa7d90fc6a5fb93a52ebf0c3e91aa80bed408c7f57a2b7db05eab4d4fe5dbee2"
},
"downloads": -1,
"filename": "lihzahrd-3.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "4b8a7d859a1994ce879471cbc350a324",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6.2",
"size": 110978,
"upload_time": "2024-09-04T18:44:32",
"upload_time_iso_8601": "2024-09-04T18:44:32.447925Z",
"url": "https://files.pythonhosted.org/packages/4d/93/741a7d6be448734b698849e26b9726042d5cae5b4363729118578a3b90b8/lihzahrd-3.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "4759a440d77f55d53f619200b2efedf3c606148549e58db69f371c1375817c26",
"md5": "ef095a0aaa0bb80f43be32a4e3a17419",
"sha256": "4be3a65e584a5d2c0fe059ff0f4da7910f0028fd5eca6e3500ac1840b05a0985"
},
"downloads": -1,
"filename": "lihzahrd-3.1.1.tar.gz",
"has_sig": false,
"md5_digest": "ef095a0aaa0bb80f43be32a4e3a17419",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6.2",
"size": 8127243,
"upload_time": "2024-09-04T18:44:44",
"upload_time_iso_8601": "2024-09-04T18:44:44.090483Z",
"url": "https://files.pythonhosted.org/packages/47/59/a440d77f55d53f619200b2efedf3c606148549e58db69f371c1375817c26/lihzahrd-3.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-04 18:44:44",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "lihzahrd"
}