json2properties¶
NAME¶
json2properties — Convert a JSON object to a Java .properties
file
SYNOPSIS¶
json2properties [<OPTIONS>] [<infile> [<outfile>]]
DESCRIPTION¶
Convert a JSON file infile
to a .properties
file and write the results
to outfile
. If not specified, infile
and outfile
default to
sys.stdin
and sys.stdout
, respectively.
The JSON document must be an object with scalar (i.e., string, numeric, boolean, and/or null) values; anything else will result in an error.
Output is sorted by key, and numeric, boolean, & null values are output using their JSON representations; e.g., the input:
{
"yes": true,
"no": "false",
"nothing": null
}
becomes:
#Mon Sep 26 18:57:44 UTC 2016
no=false
nothing=null
yes=true
OPTIONS¶
-
-E
<encoding>
,
--encoding
<encoding>
¶ Use
<encoding>
as the output encoding; default value:iso-8859-1
(a.k.a. Latin-1). (As all output is currently always pure ASCII, this option is not very useful, but there are plans to make it useful.)
-
-s
<sep>
,
--separator
<sep>
¶ Use
<sep>
as the key-value separator in the output; default value:=