Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Prettier | 45,666 | a day ago | 1,168 | mit | JavaScript | |||||
Prettier is an opinionated code formatter. | ||||||||||
Cli | 20,212 | 3,070 | 3,594 | 11 hours ago | 137 | September 11, 2022 | 45 | mit | Go | |
A simple, fast, and fun package for building command line apps in Go | ||||||||||
Yq | 8,695 | 43 | 2 days ago | 10 | February 06, 2020 | 74 | mit | Go | ||
yq is a portable command-line YAML, JSON, XML, CSV, TOML and properties processor | ||||||||||
Structured Text Tools | 6,672 | a month ago | 15 | |||||||
A list of command line tools for manipulating structured text data | ||||||||||
Jc | 6,235 | 5 days ago | 90 | July 06, 2022 | 22 | mit | Python | |||
CLI tool and python library that converts the output of popular command-line tools, file-types, and common strings to JSON, YAML, or Dictionaries. This allows piping of output to tools like jq and simplifying automation scripts. | ||||||||||
Countries | 5,709 | 399 | 77 | 22 days ago | 21 | April 04, 2020 | 37 | odbl-1.0 | PHP | |
World countries in JSON, CSV, XML and Yaml. Any help is welcome! | ||||||||||
Countries States Cities Database | 4,908 | 8 days ago | 41 | odbl-1.0 | PHP | |||||
🌍 Discover our global repository of countries, states, and cities! 🏙️ Get comprehensive data in JSON, SQL, XML, YAML, and CSV formats. Access ISO2, ISO3 codes, country code, capital, native language, timezones (for countries), and more. #countries #states #cities | ||||||||||
Dasel | 4,244 | 7 | 11 hours ago | 80 | August 24, 2022 | 26 | mit | Go | ||
Select, put and delete data from JSON, TOML, YAML, XML and CSV files with a single tool. Supports conversion between formats and can be used as a Go package. | ||||||||||
Tablib | 4,242 | 1,179 | 80 | 2 months ago | 41 | April 09, 2022 | 35 | mit | Python | |
Python Module for Tabular Datasets in XLS, CSV, JSON, YAML, &c. | ||||||||||
Tmuxp | 3,694 | 39 | 6 | 3 days ago | 175 | May 27, 2022 | 90 | mit | Python | |
:computer: tmux session manager. built on libtmux |
A command line utility and Go module that reads NBT data and converts it to JSON or YAML for editing and then back to NBT.
By defualt, the nbt2json executable waits for input from stdin, so you need to nbt2json -h
to see the help screen.
NAME:
NBT to JSON - Converts NBT-encoded data to JSON | https://github.com/midnightfreddie/nbt2json
USAGE:
nbt2json.exe [global options] command [command options] [arguments...]
VERSION:
0.4.0
AUTHOR:
Jim Nelson <[email protected]>
COMMANDS:
help, h Shows a list of commands or help for one command
GLOBAL OPTIONS:
--reverse, -r Convert JSON to NBT instead (default: false)
--gzip, -z Compress output with gzip (default: false)
--comment COMMENT, -c COMMENT Add COMMENT to json or yaml output, use quotes if contains white space
--big-endian, --java, -b Use for Minecraft Java Edition (like most other NBT tools) (default: false)
--in FILE, -i FILE Input FILE path (default: "-")
--out FILE, -o FILE Output FILE path (default: "-")
--yaml, --yml, -y Use YAML instead of JSON (default: false)
--long-as-string, -l If set, nbt long values will be a string instead of uint32 pair (default: false)
--skip NUM Skip NUM bytes of NBT input. For Bedrock's level.dat, use --skip 8 to bypass header (default: 0)
--help, -h show help (default: false)
--version, -v print the version (default: false)
COPYRIGHT:
(c) 2018, 2019, 2020 Jim Nelson
This repo is both a Go module and a command line utility. To build the utility:
cd
into repo root foldergo build ./cmd/nbt2json
will put the executable in the current directory. Important: include the ./
at the beginning or else it will throw "package cmd/nbt2json is not in GOROOT". (I do that. Every. Time.)The JSON document should be an object with an "nbt"
field which is an array.
Objects in the array represent one tag and will typically have tagType, name,
and value fields. A typical Minecraft NBT will have one compound tag with a
number of other tags inside that one. This converter needs at least one tag.
Many JSON libraries cannot properly handle a 64-bit integer, so nbt2json handles the long tag in one of two special ways for portability and compatibility.
By default it presents valueLeast and valueMost unsigned 32-bit integers. valueMost is the most significant 32 bits, so it should be rolled bitwise to the left 32 bits in a 64-bit space and added (or bitwise 'or'ed) to valueLeast to reassemble the 64-bit long singed integer. Here is an example:
{
"nbt": [
{
"tagType": 4,
"name": "LongAsUint32PairExample",
"value": {
"valueLeast": 4294967295,
"valueMost": 2147483647
}
}
]
}
Alternately it can turn the 64-bit integer into a string. This would be easier to edit by hand in a text editor. Example:
{
"nbt": [
{
"tagType": 4,
"name": "LongAsStringExample",
"value": "9223372036854775807"
}
]
}
import "github.com/midnightfreddie/nbt2json"
nbt2json.UseJavaEncoding()
and nbt2json.UseBedrockEncoding()
to change encoding mode for as long as the module is open.var myString = someByteArray[:]
or var myByteArray = []byte(someStringValue)
interface{}
and encodes based on the tagType fields. I had originally hoped to Marshal and Unmarshal to and from JSON and NBT, but my goal was to export to JSON, edit and then reencode. This way the struct doesn't have to match the data schema.Nbt2Yaml converts uncompressed NBT byte array to YAML byte array
func Nbt2Yaml(b []byte, comment string) ([]byte, error)
Nbt2Json converts uncompressed NBT byte array to JSON byte array
func Nbt2Json(b []byte, comment string) ([]byte, error)
Yaml2Nbt converts JSON byte array to uncompressed NBT byte array (Hint: You can just use this for both JSON and YAML if you like since JSON is a valid subeset of YAML)
func Yaml2Nbt(b []byte) ([]byte, error)
Json2Nbt converts JSON byte array to uncompressed NBT byte array
func Json2Nbt(b []byte) ([]byte, error)
UseJavaEndoding sets any nbt encoding/decoding to big-endian to match Minecraft Java Edition
func UseJavaEncoding()
UseBedrockEncoding sets nbt encoding/decoding to little-endian to match Minecraft Bedrock Edition (default)
func UseBedrockEncoding()
UseLongAsString sets json output for nbt long tags to numbers in strings
func UseLongAsString()
UseLongAsUint32Pair sets json output for nbt long tags to a uint32 pair (default, needed for json portability)
func UseLongAsUint32Pair()
Other exports of possible interest are in common.go.