NBT icon

NBT For Linux

  n/a
Other/Proprietary License

Named Binary Tag Reader/Writer. #Tag parser  #Named binary  #Named  #Binary  #Tag  #Parser  

Description

Free Download

NBT is a Named Binary Tag parser based upon the specification by Markus Persson.

From The spec:

"NBT (Named Binary Tag) is a tag based binary format designed to carry large  amounts of binary data with smaller amounts of additional data. An NBT file consists of a single GZIPped Named Tag of type TAG_Compound."

read the full spec at http://www.minecraft.net/docs/NBT.txt

1. Reading files.

the easiest way to read an nbt file is to instantiate an NBTFile object e.g.

 >>> import nbt  >>> nbtfile = nbt.NBTFile("bigtest.nbt",'rb')  >>> nbtfile.name.value  u'Level'  >>> nbtfile["nested compound test"].tag_info()  TAG_Compound("nested compound test"): 2 Entries  >>> for tag in nbtfile["nested compound test"]["ham"].tags:  ... print tag.tag_info()  ...  TAG_String("name"): Hampus  TAG_Float("value"): 0.75  >>> [tag.value for tag in nbtfile["listTest (long)"].tags]  [11, 12, 13, 14, 15]

2. Writing files.

Writing files is easy too! if you have a NBTFile object, simply call it's write_file() method. If the NBTFile was instantiated with a filename, then write_file needs no extra arguments. It just works. If however you created a new file object from scratch (or even if you just want to save it somewhere else) call write_file('pathtonewfile.nbt')

 >>> import nbt  >>> nbtfile = nbt.NBTFile("bigtest.nbt",'rb')  >>> nbtfile["listTest (compound)"][0].value = u'Hello World!'  >>> nbtfile.write_file("newnbtfile.nbt")

3. Creating files

Creating files is trickier but ultimately should give you no issue, as long as you have read the NBT spec (hint.. it's very short). Also be sure to note that the NBTFile object is actually a TAG_Compound with some wrapper features, so you can use all the standard tag features

>>> from nbt import *  >>> nbtfile = NBTFile()

first, don't forget to name the top level tag

 >>> nbtfile.name = TAG_String("My Top Level Tag")  >>> nbtfile.tags.append(TAG_Float(name="My Float Name", value=3.152987593947))  >>> mylist = TAG_List(name="TestList", type=TAG_Long) #type needs to be pre-declared!  >>> mylist.tags.append(TAG_Long(100))  >>> mylist.tags.extend([TAG_Long(120),TAG_Long(320),TAG_Long(19)])  >>> nbtfile.tags.append(mylist)  >>> print nbtfile.pretty_tree()  TAG_Compound("My Top Level Tag"): 2 Entries  {  TAG_Float("My Float Name"): 3.15298759395  TAG_List("TestList"): 4 entries of type TAG_Long  {  TAG_Long: 100  TAG_Long: 120  TAG_Long: 320  TAG_Long: 19  }  }  >>> nbtfile["TestList"].tags.sort(key = lambda tag: tag.value)  >>> print nbtfile.pretty_tree()  TAG_Compound("My Top Level Tag"): 2 Entries  {  TAG_Float("My FloatName"): 3.15298759395  TAG_List("TestList"): 4 entries of type TAG_Long  {  TAG_Long: 19  TAG_Long: 100  TAG_Long: 120  TAG_Long: 320  }  }  >>> nbtfile.write_file("mynbt.dat")

System requirements

NBT 1.3

add to watchlist add to download basket send us an update REPORT
  runs on:
Linux
  main category:
Utilities
  developer:
  visit homepage

Windows Sandbox Launcher 1.0.0

Set up the Windows Sandbox parameters to your specific requirements, with this dedicated launcher that features advanced parametrization
Windows Sandbox Launcher

Microsoft Teams 24060.3102.2733.5911 Home / 1.7.00.7956 Work

Effortlessly chat, collaborate on projects, and transfer files within a business-like environment by employing this Microsoft-vetted application
Microsoft Teams

4k Video Downloader 1.5.3.0080 Plus / 4.30.0.5655

Export your favorite YouTube videos and playlists with this intuitive, lightweight program, built to facilitate downloading clips from the popular website
4k Video Downloader

IrfanView 4.67

With support for a long list of plugins, this minimalistic utility helps you view images, as well as edit and convert them using a built-in batch mode
IrfanView

7-Zip 23.01 / 24.04 Beta

An intuitive application with a very good compression ratio that can help you not only create and extract archives, but also test them for errors
7-Zip

ShareX 16.0.1

Capture your screen, create GIFs, and record videos through this versatile solution that includes various other amenities: an OCR scanner, image uploader, URL shortener, and much more
ShareX

paint.net 5.0.13 (5.13.8830.42291)

Packed with an array of options and an intuitive interface, this application enables you to create professional-looking photographs
paint.net

Zoom Client 6.0.0.37205

The official desktop client for Zoom, the popular video conferencing and collaboration tool used by millions of people worldwide
Zoom Client

Bitdefender Antivirus Free 27.0.35.146

Feather-light and free antivirus solution from renowned developer that keeps the PC protected at all times from malware without requiring user configuration
Bitdefender Antivirus Free

calibre 7.9.0

Effortlessly keep your e-book library thoroughly organized with the help of the numerous features offered by this efficient and capable manager
calibre

% discount
Zoom Client
  • Zoom Client
  • Bitdefender Antivirus Free
  • calibre
  • Windows Sandbox Launcher
  • Microsoft Teams
  • 4k Video Downloader
  • IrfanView
  • 7-Zip
  • ShareX
  • paint.net
essentials


User Comments
This enables Disqus, Inc. to process some of your data. Disqus privacy policy