Skip to main content

Minecraft NBT parser

Project description

nbtx - NBT parser in Python

Zero-dependency, strictly-typed NBT parser and writer.

Installation (Library)

Because the entire implementation finds place in a single file and does not depend on third-party libraries, you can simply copy src/nbtx/__init__.py to your project. Alternatively, you can install nbtx by using a package manager.

Pip

pip install nbtx

Poetry

poetry add nbtx

uv

uv add nbtx

Installation (CLI)

pipx

pipx install nbtx

Usage (Library)

import nbtx

with open("file.nbt", "rb") as f:
    content = nbtx.load(f)

print(content.pretty())

Usage (CLI)

You can display the contents of an NBT file by using the CLI of nbtx:

Read Big Endian NBT File

cat samples/bigtest.nbt | nbtx -e big
# or
nbtx -e big samples/bigtest.nbt

Read Little Endian NBT File

cat samples/caged_villager.mcstructure | nbtx -e little
# or
nbtx -e little samples/caged_villager.mcstructure

References

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

nbtx-0.4.1.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nbtx-0.4.1-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

Details for the file nbtx-0.4.1.tar.gz.

File metadata

  • Download URL: nbtx-0.4.1.tar.gz
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.11.14 Linux/6.17.5-arch1-1

File hashes

Hashes for nbtx-0.4.1.tar.gz
Algorithm Hash digest
SHA256 4cff89779883ef639a71ca31c39b56bca4f238b4f1bebcd9527c871eda22955b
MD5 c8ee846a86cee6d72452327294753c51
BLAKE2b-256 05aa5ddb9e17f34ce158774476c05e144076ee8b467be3cb7022c434df0df94c

See more details on using hashes here.

File details

Details for the file nbtx-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: nbtx-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 9.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.11.14 Linux/6.17.5-arch1-1

File hashes

Hashes for nbtx-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cea2abc9126ab5788cef5898fbb4e83396429dcb4437b4ba9417c8a7c07be755
MD5 e6a1dad909344f11d423110a43b5c4a0
BLAKE2b-256 6651e6f3f0b75a2494e5ab1e5914535b03834a2a50edacd93e0ec3006a14d6c3

See more details on using hashes here.

Supported by

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