Skip to content

Fork of simplejson, natively supporting datetimes and UUIDs: on Py3 consider using python-rapidjson instead

License

Notifications You must be signed in to change notification settings

lelit/nssjson

 
 

Repository files navigation

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

About

Fork of simplejson, natively supporting datetimes and UUIDs: on Py3 consider using python-rapidjson instead

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 52.4%
  • C 46.8%
  • Makefile 0.8%