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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file nr.databind.json-0.0.2.tar.gz
.
File metadata
- Download URL: nr.databind.json-0.0.2.tar.gz
- Upload date:
- Size: 8.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.33.0 CPython/3.7.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d2dfeb6402b57f166107dc0e0a33f1d1927915e34b58f861d6f84e110dbde857 |
|
MD5 | 34f3f1360b6e6977ffcc68d98a99d483 |
|
BLAKE2b-256 | c41db7c66e0c451a1e343ce63495585b5c94d02fc46bc1c08fdcd62b6f332320 |