Skip to main content

A fork of Python's built-in JSON module, but with added support for decimal.Decimal objects.

Install using:

pip install json_with_decimals

Similar to the proposal given in this issue.

By default, decoded JSON will return decimal.Decimal objects for real numbers, and the encoder supports decimal.Decimal numbers.

Encoding decimals will disable the speedup from the C encoder, so you can temporarily disable decimal support with the support_decimal keyword argument:

import json_with_decimals as json
json.dumps(obj, support_decimal=False)

Metadata

Release files for json-with-decimals 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for json-with-decimals 0.1.0
File Size Uploaded Provenance Actions
json_with_decimals-0.1.0.tar.gz 18.1 kB Without provenance Details for json_with_decimals-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for json-with-decimals 0.1.0
File Interpreter ABI Platform Actions
json_with_decimals-0.1.0-py3-none-any.whl Python 3 none any Details for json_with_decimals-0.1.0-py3-none-any.whl

Total release size: 38.7 kB

Release files / json_with_decimals-0.1.0.tar.gz

Download URL json_with_decimals-0.1.0.tar.gz
Size 18.1 kB
Tags Source
SHA-256 checksum
How to use checksums
eb10896fcdbe32faeba095a9ec9fac71d03382d95431e900e7d6d2809f9d1f62
BLAKE2b-256 checksum
How to use checksums
433dfc8a459077276fe003895bc595cbb4c7911d8e05777691903e7b1b63bcbc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.3

Release files / json_with_decimals-0.1.0-py3-none-any.whl

Download URL json_with_decimals-0.1.0-py3-none-any.whl
Size 20.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1ec15f130482904fe421da658ed12590802bc3b5c695a2a5f7a85c400ed21a71
BLAKE2b-256 checksum
How to use checksums
07e50aa4c2f1374996afc3bdc1f836526cb26afc7ea8aa520ed4da3b57cfdc13
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.3

Security for json-with-decimals 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page