Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/randomir/jsonplus
Serialization of Python types to JSON that works out of the box (batteries included).
https://github.com/randomir/jsonplus
django flask json json-serialization python
Last synced: 3 months ago
JSON representation
Serialization of Python types to JSON that works out of the box (batteries included).
- Host: GitHub
- URL: https://github.com/randomir/jsonplus
- Owner: randomir
- License: other
- Created: 2016-10-11T21:09:11.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-07-12T11:32:50.000Z (over 5 years ago)
- Last Synced: 2024-10-03T09:31:15.991Z (4 months ago)
- Topics: django, flask, json, json-serialization, python
- Language: Python
- Homepage:
- Size: 85 KB
- Stars: 12
- Watchers: 3
- Forks: 4
- Open Issues: 3
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
JSON+
=====Serialization of common data types (which are out of the JSON specs_) that works
out of the box (batteries included).So far, modules (packages) for Python_, Flask_ and Django_ are implemented, and
they support (de-)serialization of types like:- ``tuple`` and ``namedtuple``
- ``set`` and ``frozenset``
- ``complex``, ``Decimal``, and ``Fraction``
- ``datetime``, ``date``, ``time``, and ``timedelta``
- ``UUID``, ``moneyed.Money``, ``moneyed.Currency``(in addition to basic JSON supported-types like integers, floats, lists, and dictionaries).
Also, encoder and decoder for custom (user) types can easily be registered (see python_ example).
Overview
--------+----------------------+----------------+--------------------------------------------------------------+
| Language/Framework | Source | Implemented |
+======================+================+==============================================================+
| Python 2.6+, 3.3+ | python_ | (De-)Serialization drop-in replacement for ``simplejson``. |
| | | Exact & compatibility mode supported. See detailed docs_. |
+----------------------+----------------+--------------------------------------------------------------+
| Django 1.8+ | python-django_ | As ``jsonplus`` + database model field ``JSONPlusField``. |
+----------------------+----------------+--------------------------------------------------------------+
| Flask 0.10+ | python-flask_ | Using ``jsonplus`` as the default Flask (de-)serializator. |
+----------------------+----------------+--------------------------------------------------------------+
| JavaScript | n/a | TODO |
+----------------------+----------------+--------------------------------------------------------------+.. _specs: https://tools.ietf.org/html/rfc7159.html
.. _docs: https://github.com/randomir/jsonplus/tree/master/python
.. _Python: https://github.com/randomir/jsonplus/tree/master/python
.. _python: https://github.com/randomir/jsonplus/tree/master/python
.. _Flask: https://github.com/randomir/jsonplus/tree/master/python-flask
.. _python-flask: https://github.com/randomir/jsonplus/tree/master/python-flask
.. _Django: https://github.com/randomir/jsonplus/tree/master/python-django
.. _python-django: https://github.com/randomir/jsonplus/tree/master/python-django