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.2.tar.gz
(10.3 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file databind.json-2.0.2.tar.gz.
File metadata
- Download URL: databind.json-2.0.2.tar.gz
- Upload date:
- Size: 10.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.64.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0bc5514db57a252b361f4d00cf37302e6eb12a88aa9f5d791a441469c1793ef6
|
|
| MD5 |
d56ea70a99f7161acaad7fd7830dffdc
|
|
| BLAKE2b-256 |
d836dbecd48b860400764c3df005a8098fb0c1b9142d951f78818ce857183287
|
File details
Details for the file databind.json-2.0.2-py3-none-any.whl.
File metadata
- Download URL: databind.json-2.0.2-py3-none-any.whl
- Upload date:
- Size: 10.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.64.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6e1fc83fa1d0309f8e9792e3f851e20bd489bc8c41eda7c47fe8de66bbfafa77
|
|
| MD5 |
61e161fe2570fd272e8cfac640308b08
|
|
| BLAKE2b-256 |
5e89b9f77aff1df2925f5fd71255d2b1a02c3078c22b8e468b875d1066e1ae62
|