From what I see, mjson module just convert the input to json and back to string with indentation and sorted keys.
This can be done with:
>>> json.dumps(json.loads('{"k":0.000000581}', indent=2, sort_keys=True))
'{"k": 5.81e-07}'
To avoid the scientifique notation, see @Veedrac answer on the subject:
https://stackoverflow.com/a/18936966/956660
Edit: Any tools that only reformat and does not try to parse/cast types will work.
I tried with yajl-tools
:
user$ sudo apt-get install yajl-tools
user$ echo '{"a": 0.0000000000000001337}' | json_pp
{
"a" : 1.337e-16
}
user$ echo '{"a": 0.0000000000000001337}' | json_reformat
{
"a": 0.0000000000000001337
}