JSON with float formatting.
The json module in the Python standard
library does not allow you to specify the format in which floats 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.
Release files for fjson 0.1.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| fjson-0.1.6.tar.gz | 4.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| fjson-0.1.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.1 kB
Release files / fjson-0.1.6.tar.gz
| Download URL | fjson-0.1.6.tar.gz |
|---|---|
| Size | 4.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0ea0a6df68104239b57acf542bfebd9bf23e009af7f6d34861ace36742d6b383
|
|
BLAKE2b-256 checksum How to use checksums |
31b489fb81641de93ea0c0b7eafb680f666e8a5bb74902efa18598e1dd834d5f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.11.0+
|
Release files / fjson-0.1.6-py3-none-any.whl
| Download URL | fjson-0.1.6-py3-none-any.whl |
|---|---|
| Size | 5.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5b968a9734aa587c3fb8cbd05809e9c22b34d95a67dde8124913e61ceb629b5b
|
|
BLAKE2b-256 checksum How to use checksums |
6b63b2ee807afb39ec8af6cfbc49db85d75150aae7bc66217c8fd7af5a436f55
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.11.0+
|