Skip to main content

nssjson

JSON encoder/decoder for Python

nssjson is a (not so) simple, fast, complete, correct and extensible JSON encoder and decoder for Python 2.5+ and Python 3.3+. It is pure Python code with no dependencies, but includes an optional C extension for a serious speed boost.

nssjson is a fork of simplejson that fulfills my need of having a good performance JSON encoder/decoder able to handle also Python’s datetime and UUID, even if with an admittedly non-standard and faulty heuristic that was not considered within the scope of the original product.

Practically, the difference is that, out of the box, you have:

>>> import datetime, uuid
>>> import nssjson
>>> now = datetime.datetime.now()
>>> uid = uuid.uuid1()
>>> nssjson.loads(
...     nssjson.dumps([uid, now], iso_datetime=True, handle_uuid=True),
...     iso_datetime=True, handle_uuid=True) == [uid, now]
True

Changes

0.7 (2015-08-07)

  • Optionally serialize/deserialize UUIDs

0.6 (2015-05-31)

  • Avoid broken JSON output for int/long/float subclasses reimplementing the __str__() and/or __repr__() methods

0.5 (2014-12-21)

  • Fix memory leak when an error occurs encoding dict items

  • Overhaul of load() and dump() signatures

  • Drop Sphinx documentation

0.4 (2014-06-28)

  • Complete the fix against negative index parameter to raw_decode()

  • Fix C encoder initialization

  • Catch invalid item_sort_key argument to C encoder

0.3 (2014-04-16)

0.2 (2014-03-22)

  • Remove dead code noticed by Anatoly Techtonik

  • Use an interned instance of the UTC timezone instead of passing it as an argument to function/constructors

0.1 (2014-03-19)

Metadata

Release files for nssjson 0.7

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

Source distribution (sdist)

Source distribution for nssjson 0.7
File Size Uploaded Provenance
nssjson-0.7.tar.gz 62.2 kB Without provenance Details

Release files / nssjson-0.7.tar.gz

Download URL nssjson-0.7.tar.gz
Size 62.2 kB
Tags Source
SHA-256 checksum
How to use checksums
4970f7742596df652f287c01c96ed397b4ce17a2e38d4947f6423d2c61dbdb01
BLAKE2b-256 checksum
How to use checksums
99e91f4b50de2dcd4a72ec1e31dc03c781aca33abe71c221e975dde1e1e65e4e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for nssjson 0.7

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.

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