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.3.1.tar.gz
(11.4 kB
view hashes)
Built Distribution
Close
Hashes for databind.json-1.3.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 654285289cfad7601ed9b85f7868e84bc7ca82bf3c3e60fc66dd9726d7ac65cf |
|
MD5 | 8698abab7bcc8e45afb6e2183b4c6f19 |
|
BLAKE2b-256 | 09583a832c23512c332cdd83f79b3160d30e7cb45291e7dbaf8dd0f89ba59647 |