De-/serialize Python dataclasses to or from JSON payloads. Compatible with Python 3.7 and newer.
Project description
databind.json
The databind.json
package implements the de-/serialization to or from JSON payloads using
the databind.core
framework.
Quickstart
import databind.json
import dataclasses
@dataclasses.dataclass
class ServerConfig:
host: str
port: int = 8080
@dataclasses.dataclass
class MainConfig:
server: ServerConfig
payload = { 'server': { 'host': '127.0.0.1' } }
config = databind.json.load(payload, MainConfig)
assert config == MainConfig(ServerConfig('127.0.0.1'))
Copyright © 2020 – Niklas Rosenstein
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
databind.json-1.4.0.tar.gz
(11.6 kB
view hashes)
Built Distribution
Close
Hashes for databind.json-1.4.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b8730986f039435302b2b21afbde2f6b045e0fb4268517c493c38c50fc674fcf |
|
MD5 | 7246ba99cff2c16280866347382f5990 |
|
BLAKE2b-256 | a2f8d82abe6e2b7c2278a77dda63da57d991d7c4143905bd686669a5e7f64439 |