Skip to main content

Python JSON writer with float formatting

Project description


JSON with float formatting.

PyPi Version PyPI pyversions GitHub stars Downloads

gh-actions codecov Code style: black

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=(", ", ": "))
  "a": 1,
  "b": 3.141593e+00


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)

Uploaded Source

Built Distribution

fjson-0.1.6-py3-none-any.whl (5.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page