Metadata-Version: 2.1
Name: nr.databind.json
Version: 0.0.13
Summary: Deserialize JSON into Python objects and reverse.
Home-page: https://git.niklasrosenstein.com/NiklasRosenstein/nr-python-libs
Author: Niklas Rosenstein
Author-email: rosensteinniklas@gmail.com
License: MIT
Description-Content-Type: text/markdown
Requires-Dist: nr.collections<1.0.0,>=0.0.1
Requires-Dist: nr.databind.core<0.1.0,>=0.0.16
Requires-Dist: nr.interface<0.1.0,>=0.0.1
Requires-Dist: nr.parsing.date<1.0.0,>=0.1.0
Requires-Dist: nr.pylang.utils<0.1.0,>=0.0.1
Provides-Extra: test
Requires-Dist: pytest; extra == "test"
Requires-Dist: PyYAML; extra == "test"
Requires-Dist: flask; extra == "test"

# nr.databind.json

The `nr.databind.json` package implements (de-) serializers for nested payloads that usually
result from loading JSON-formatted data.

See also [nr.databind.core](https://git.niklasrosenstein.com/NiklasRosenstein/nr/src/branch/master/nr.databind.core).

## Example

```py
from nr.databind.core import Field, Struct, ObjectMapper
from nr.databind.json import JsonModule

class Person(Struct):
    name = Field(str, prominent=True)
    age = Field(int)
    address = Field(int, default=None)

mapper = ObjectMapper(JsonModule())
print(mapper.deserialize({'name': 'John Wick', 'age': 48, 'address': 'Wicked St.'}))  # Person(name='John Wick')
```
