⚙️ NBT#

Usage Example#
from scfile import formats

with formats.nbt.NbtDecoder("path/to/itemnames.dat") as nbt:
  data = nbt.decode()

with formats.json.JsonEncoder(data) as json:
  json.encode().save("output.json")

Decoder#

class NbtDecoder(file, options=None)[source]#

Bases: FileDecoder[NbtContent], StructFileIO

format: FileFormat = 'nbt'#
order: ByteOrder = '<'#
to_json()[source]#
parse()[source]#

Parse file content into self.data.

Enums#

class Tag(value)[source]#

Bases: IntEnum

END = 0#
BYTE = 1#
SHORT = 2#
INT = 3#
LONG = 4#
FLOAT = 5#
DOUBLE = 6#
BYTE_ARRAY = 7#
STRING = 8#
LIST = 9#
COMPOUND = 10#
INT_ARRAY = 11#
LONG_ARRAY = 12#

IO#

class NbtBytesIO(initial_bytes=b'')[source]#

Bases: StructBytesIO

order: ByteOrder = '>'#