Well-structured helpers to help serializing commonly encountered structures to JSON (like datetime, to_dict(), etc.
Project description
jsonext makes it easy to serialize objects outside of the standard Python primitives to JSON:
>>> import jsonext >>> from datetime import datetime >>> jsonext.dumps(datetime.now()) '"2014-03-22T22:17:18.304528+00:00"' >>> jsonext.dumps(i**2 for i in range(10)) '[0, 1, 4, 9, 16, 25, 36, 49, 64, 81]'
It uses mixins to the standard encoder to achieve this and is easily reuse- and extensible. Check out the documentation for details.
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
jsonext-0.4.1.tar.gz
(2.6 kB
view details)
File details
Details for the file jsonext-0.4.1.tar.gz
.
File metadata
- Download URL: jsonext-0.4.1.tar.gz
- Upload date:
- Size: 2.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7b2d30762d7009d43804a20681c132cebad40c60382c774efc1b065f76aafbad |
|
MD5 | 50c8dc87004355a8123c52aba2ee3914 |
|
BLAKE2b-256 | 616998132be563a1cfd679b6ee5cfc9f6ef5ffbe1025e99f8514b1dceda4b359 |