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.2.0.tar.gz (8.5 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.2.0-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nbtx-0.2.0.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.11.13 Linux/6.16.5-arch1-1

File hashes

Hashes for nbtx-0.2.0.tar.gz
Algorithm Hash digest
SHA256 518aac936c53fe19313de269b882deaf535e3f9b7f5cd2544738cd46aa22c17a
MD5 3e38abffb4ac814c41cbc162ae150ea3
BLAKE2b-256 61801e59c76b59b4f87e5aed588bbfa4c278f8573d4dee1ac36e039ae905bc65

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for nbtx-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 562c80754b9027be62a1f7e5ef2e947eeb06662011452158297c9f82abea1372
MD5 fc1f362a5543621de6fb59220908323d
BLAKE2b-256 9e06ec50e437b590f9c5756d84ee9d7f5320a03afbae6be4d0265bcae9242adf

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