pyjson5 - formatter for JSON5 documents
Contents
Description
A tool to parse and pretty-print JSON5.
Examples
$ echo '{foo:"bar"}' | pyjson5
{
foo: 'bar',
}
$ echo '{foo:"bar"}' | pyjson5 --as-json
{
"foo": "bar"
}
pyjson5 April 2024 PYJSON5(1)
Name
pyjson5 - formatter for JSON5 documents
Options
positionalarguments:
FILE optional file to read JSON5 document from; if not specified or "-", will read from stdin instead
options:-h, --help
show this help message and exit
-V, --version
print the version and exit
-c STR inline json5 string to read instead of reading from a file
--as-json
output as JSON (same as --quote-keys--no-trailingcommas)
--indent INDENT
amount to indent each line (default is 4 spaces)
--quote-keys
quote all object keys
--no-quote-keys
don't quote object keys that are identifiers (this is the default)
--trailing-commas
add commas after the last item in multi-line objects and arrays (this is the default)
--no-trailing-commas
do not add commas after the last item in multi-line lists and objects
Synopsis
json5[-h][-V][-cSTR][--as-json][--indentINDENT][--quote-keys][--no-quote-keys][--trailing-commas][--no-trailing-commas][FILE]
