Skip to main content

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.7.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

databind.json-2.0.7-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

Details for the file databind.json-2.0.7.tar.gz.

File metadata

  • Download URL: databind.json-2.0.7.tar.gz
  • Upload date:
  • Size: 10.4 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

Hashes for databind.json-2.0.7.tar.gz
Algorithm Hash digest
SHA256 f21b49264750cc1d85eaf8678e4a00319e6a349f4e0ffc2949d86b9141d0c302
MD5 8e1544e2945b6aae1eb2fa3387b257e6
BLAKE2b-256 2f15f58afef154b974fc3de376b6cbefaf5bc16cb1575b5f93cb024c4920a2ef

See more details on using hashes here.

File details

Details for the file databind.json-2.0.7-py3-none-any.whl.

File metadata

  • Download URL: databind.json-2.0.7-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

Hashes for databind.json-2.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 5abe4b769407b22387f5c2a18db1654afc9d3f7ea2acdc672f16b4ecbe3e8a4a
MD5 5116881e595ddd58a89112d8647013e5
BLAKE2b-256 3607d475aa1ea1fc97a09e955952ea4a5dcb057c31594f247098268f4ca24633

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page