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.2.2.tar.gz
(10.6 kB
view hashes)
Built Distribution
Close
Hashes for databind.json-1.2.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d8a9a742bfcd644b90082ec211c27190a14eb9cdfbb65ae31fdda6105bf96056 |
|
MD5 | 07c778a5eb468fb3aba5c5858c90cdf1 |
|
BLAKE2b-256 | 9bb58d8e1417d4afe11be7d908ddf3090d1beba338fc5815d42bd32bf489f8ef |