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.3.tar.gz
(10.7 kB
view hashes)
Built Distribution
Close
Hashes for databind.json-1.2.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ea1f27dc5a8003539497e734b49fe9c0a0063c36d65e2e41dfba076a919c4ec8 |
|
MD5 | 5e4b2593d76331417bc683be389e6fc3 |
|
BLAKE2b-256 | f31796ab93ae5a706ed66ab4c02391831414abc00767d9a0b6f03f536e86c8c4 |