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.0.tar.gz
(10.6 kB
view hashes)
Built Distribution
Close
Hashes for databind.json-1.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 06053e03ad732c6887f315e71d9aa5eaf655cf036560a9011c65918405b58647 |
|
MD5 | e5c23e2ee667797f55944f7321b81744 |
|
BLAKE2b-256 | 1488d5f5b08d1e3e61560b2138fb6603bd3ab3c9884ed99b95398081419839f5 |