Metadata-Version: 2.1
Name: jsons
Version: 0.8.2
Summary: For serializing Python objects to JSON (dicts) and back
Home-page: https://github.com/ramonhagenaars/jsons
Author: Ramon Hagenaars
Author-email: ramon.hagenaars@gmail.com
License: UNKNOWN
Platform: UNKNOWN
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Natural Language :: English
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Description-Content-Type: text/x-rst

|PyPI version| |Docs| |Build Status| |Code Coverage| |Scrutinizer Code Quality|
|Maintainability|

::

       _                     
      (_)                    
       _ ___  ___  _ __  ___ 
      | / __|/ _ \| '_ \/ __|
      | \__ | (_) | | | \__ \
      | |___/\___/|_| |_|___/
     _/ | JSON SERIALIZATION                   
    |__/      MADE EASY!               


*~ Any Python objects to/from JSON, easily! ~*


+--------------------------------------------------------+----------------------------------------------------------------------+
| * *Python 3.5+*                                        | **Example of a model to be serialized:**                             |
|                                                        |                                                                      |
| * *Minimal effort to use!*                             | .. code:: python                                                     |
|                                                        |                                                                      |
| * *No magic, just you, Python and jsons!*              |                                                                      |
|                                                        |     @dataclass                                                       |
| * *Human readible JSON without pollution!*             |     class Person:                                                    |
|                                                        |         name: str                                                    |
| * *Easily customizable and extendable!*                |         birthday: datetime                                           |
|                                                        |                                                                      |
| * *Type hints for the win!*                            | **Example of the serialization:**                                    |
|                                                        |                                                                      |
|                                                        |                                                                      |
|                                                        | .. code:: python                                                     |
|                                                        |                                                                      |
|                                                        |                                                                      |
|                                                        |     jsons.dump(Person('Guido van Rossum', birthday_guido))           |
|                                                        |                                                                      |
|                                                        |                                                                      |
|                                                        | **Output after serialization:**                                      |
|                                                        |                                                                      |
|                                                        |                                                                      |
|                                                        | .. code:: python                                                     |
|                                                        |                                                                      |
|                                                        |                                                                      |
|                                                        |     {'birthday': '1956-01-31T12:00:00Z', 'name': 'Guido van Rossum'} |
+--------------------------------------------------------+----------------------------------------------------------------------+

************
Installation
************

::

   pip install jsons

*****
Usage
*****

.. code:: python

   import jsons

   some_instance = jsons.load(some_dict, SomeClass)  # Deserialization
   some_dict = jsons.dump(some_instance)  # Serialization

In some cases, you have instances that contain other instances that need
(de)serialization, for instance with lists or dicts. You can use the
``typing`` classes for this as is demonstrated below.

.. code:: python

   from typing import List, Tuple
   import jsons

   # For more complex deserialization with generic types, use the typing module
   list_of_tuples = jsons.load(some_dict, List[Tuple[AClass, AnotherClass]])

(For more examples, see the
`FAQ <https://jsons.readthedocs.io/en/latest/faq.html>`_)

*************
Documentation
*************
* `Main documentation <https://jsons.readthedocs.io/en/latest/>`_
* `API docs <https://jsons.readthedocs.io/en/latest/api.html>`_
* `FAQ <https://jsons.readthedocs.io/en/latest/faq.html>`_


****
Meta
****

Recent updates
==============

0.8.2
+++++
- Bugfix: Dumping a namedtuple resulted in a list rather than a dict.
- Feature: Loading into named tuples can be from lists and dicts.

0.8.1
+++++
- Bugfix: Loading a verbose dump worked only shallow.

0.8.0
+++++
- Feature: Dumping objects can be verbose.
- Feature: Loading enums without `use_enum_name` can be with names or values.
- Bugfix: Loading empty namedtuples caused a problem.

0.7.2
+++++
- Bugfix: Package problem.

0.7.1
+++++
- Bugfix: Deserializing named tuples raised an exception
- Impl: Restructure of the code (splitted functions, moved to packages, ...)

0.7.0
+++++
- Doc: Improved API documentation
- Feature: Support for loading Union or Optional
- Feature: Extended strict-mode
- Feature: Added custom Exceptions
- Feature: Support for attr-getters
- Bugfix: Local timezone for datetime serialization improved

0.6.1
+++++
- Feature: Support for loading tuples of variable length


Contributors
============
Special thanks to the following contributors:


- `finetuned89 <https://github.com/finetuned89>`_
- `haluzpav <https://github.com/haluzpav>`_

.. |PyPI version| image:: https://badge.fury.io/py/jsons.svg
   :target: https://badge.fury.io/py/jsons

.. |Docs| image:: https://readthedocs.org/projects/jsons/badge/?version=latest
   :target: https://jsons.readthedocs.io/en/latest/?badge=latest
   :alt: Documentation Status

.. |Build Status| image:: https://api.travis-ci.org/ramonhagenaars/jsons.svg?branch=master
   :target: https://travis-ci.org/ramonhagenaars/jsons

.. |Code Coverage| image:: https://codecov.io/gh/ramonhagenaars/jsons/branch/master/graph/badge.svg
  :target: https://codecov.io/gh/ramonhagenaars/jsons

.. |Scrutinizer Code Quality| image:: https://scrutinizer-ci.com/g/ramonhagenaars/jsons/badges/quality-score.png?b=master
   :target: https://scrutinizer-ci.com/g/ramonhagenaars/jsons/?branch=master

.. |Maintainability| image:: https://api.codeclimate.com/v1/badges/17d997068b3387c2f2c3/maintainability
   :target: https://codeclimate.com/github/ramonhagenaars/jsons/maintainability


