Python JSON writer with float formatting
Project description
JSON with float formatting.
The json module in the Python standard
library does not allow you to specify the format in which float
s are written out the
file. This module adds the float_format
parameter.
import math
import fjson
data = {"a": 1, "b": math.pi}
string = fjson.dumps(data, float_format=".6e", indent=2, separators=(", ", ": "))
print(string)
{
"a": 1,
"b": 3.141593e+00
}
License
fjson is published under the MIT license.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
fjson-0.1.6.tar.gz
(4.1 kB
view hashes)
Built Distribution
fjson-0.1.6-py3-none-any.whl
(5.0 kB
view hashes)