Skip to main content

Deserialize JSON into Python objects and reverse.

Project description

Note: This package is in the dangerous land of 0.x.y versions and may be subject to breaking changes with minor version increments.

This package is superseded by databind.core.

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.

Example

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(str, default=None)

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

Copyright © 2020 Niklas Rosenstein

Project details


Download files

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

Source Distribution

nr.databind.json-0.0.14.tar.gz (9.7 kB view hashes)

Uploaded Source

Built Distribution

nr.databind.json-0.0.14-py2.py3-none-any.whl (12.1 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page