Skip to main content

json with iso datetimes and custom types

Project description

Uses builtin json. but adds a lookup dictionary with functions that encode/decode specific types.


$ pip install jsonplustypes

by default it is able to:

encode dat
by default it is able to:

* encode datetime,date and bson ObjectId's to and from
custom TYPE/VALUE dict
* dump with float precision if you want to cut off digits

Custom objects are encoded in the following verbose dict format (with datetime as example):


the github repo holds a reference javascript implementation of the same json serialization/deserialization

now loads and dumps iso datetime strings with the format:

fixed the strange float precision limiter
not based on monkeypatching the json.encoder.FLOAT_REPR and json.encoder.c_make_encoder, which means it now runs without the C speedups

added encoder for and bson ObjectId

fixed bug - JSONEncoder -> json.JSONEncoder

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for jsonplustypes, version 0.7.6
Filename, size File type Python version Upload date Hashes
Filename, size jsonplustypes-0.7.6.tar.gz (2.3 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page