Skip to main content

Deserialize JSON into Python objects and reverse.

Project description

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

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

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.5.tar.gz (8.8 kB view details)

Uploaded Source

File details

Details for the file nr.databind.json-0.0.5.tar.gz.

File metadata

  • Download URL: nr.databind.json-0.0.5.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.5

File hashes

Hashes for nr.databind.json-0.0.5.tar.gz
Algorithm Hash digest
SHA256 2d7b7fd1a846705d877764cac70af73c4353276be94cc57588968aa565fec564
MD5 0a179007505fc6029808ca39ed60f3ab
BLAKE2b-256 d844ed4519aa066540190287bace54d90eae74a3ca97f677a6bc650e77e3b3ed

See more details on using hashes here.

Provenance

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