JSON encoder/decoder hooks for Python dataclasses
Project description
JSON encoder/decoder hooks for Python dataclasses
This project contains custom hooks that can be used with Python's json package. These hooks can be to produce JSON from and to predefined existing dataclasses.
Source: https://stackoverflow.com/questions/53376099/python-dataclass-from-dict#answer-53505530
Usage
json_str = json.dumps(dataclass_object, default=dataclass_object_dump)
dataclass_object = json.loads(json_str, object_hook=dataclass_object_load)
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
Built Distribution
Close
Hashes for json_dataclass_io_hooks-0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | eeda2bbc5eeff95ba71dc9d066bafdec804ef88f33d2d98df8d31da1624ad8f4 |
|
MD5 | f907377c90073a41d3785d7c73074181 |
|
BLAKE2b-256 | ea1549ff26b1891e538f70dbc69c4c576562ac9d335dd4089a4907664ecc37d4 |
Close
Hashes for json_dataclass_io_hooks-0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eedd914028381ac1ca4438a71f82c618656c05c1518bb45bb99894d160a81f93 |
|
MD5 | bf26149913f8f7f015b1de18e912ca41 |
|
BLAKE2b-256 | bc88ffdc1f1a4e08a05596e41e5cebed814a177601411076de932a1744b8e7ae |