Scroll to navigation

PYJSON5(1) User Commands PYJSON5(1)

NAME

pyjson5 - manual page for pyjson5

SYNOPSIS

json5 [-h] [-V] [-c STR] [--as-json] [--indent INDENT] [--quote-keys][--no-quote-keys] [--trailing-commas] [--no-trailing-commas][FILE]

DESCRIPTION

A tool to parse and pretty-print JSON5.

OPTIONS

positional arguments:

optional file to read JSON5 document from; if not specified or "-", will read from stdin instead

options:

show this help message and exit
print the version and exit
inline json5 string to read instead of reading from a file
output as JSON (same as --quote-keys --no-trailingcommas)
amount to indent each line (default is 4 spaces)
quote all object keys
don't quote object keys that are identifiers (this is the default)
add commas after the last item in multi-line objects and arrays (this is the default)
do not add commas after the last item in multi-line lists and objects

EXAMPLES

$ echo '{foo:"bar"}' | pyjson5
{
foo: 'bar',
}
$ echo '{foo:"bar"}' | pyjson5 --as-json
{
"foo": "bar"
}
April 2024 pyjson5