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-2.0.0a1.tar.gz
(10.2 kB
view hashes)
Built Distribution
Close
Hashes for databind.json-2.0.0a1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 659a551c4e9333ef459c3bd0a43472641fcf78f6496fa1c72e7b01e708491a5b |
|
MD5 | 657a45d2e79155ac53665ea2cc65abe7 |
|
BLAKE2b-256 | e77ce45dbdd67b7caa949581f6e3a634dc07b17abc5f58410e75425b44f7faf1 |