A fork of Python's built-in JSON module, but with added support for decimal.Decimal objects
Project description
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)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file json_with_decimals-0.1.0.tar.gz.
File metadata
- Download URL: json_with_decimals-0.1.0.tar.gz
- Upload date:
- Size: 18.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eb10896fcdbe32faeba095a9ec9fac71d03382d95431e900e7d6d2809f9d1f62
|
|
| MD5 |
02023af71247cedd1ad463c39826aef8
|
|
| BLAKE2b-256 |
433dfc8a459077276fe003895bc595cbb4c7911d8e05777691903e7b1b63bcbc
|
File details
Details for the file json_with_decimals-0.1.0-py3-none-any.whl.
File metadata
- Download URL: json_with_decimals-0.1.0-py3-none-any.whl
- Upload date:
- Size: 20.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1ec15f130482904fe421da658ed12590802bc3b5c695a2a5f7a85c400ed21a71
|
|
| MD5 |
8fffb589659ddc026519005ddd345bce
|
|
| BLAKE2b-256 |
07e50aa4c2f1374996afc3bdc1f836526cb26afc7ea8aa520ed4da3b57cfdc13
|