Create data objects that can be easily converted to and from dicts suitable for use as JSON
Project description
Dodge is a Python library that allows easy creation of data objects. These data objects can then be converted from and to dictionaries, allowing easy JSON serialisation.
Example
import dodge
Instrument = dodge.data_class("Instrument", [
"name",
"material",
])
saxophone = Instrument("saxophone", "brass")
serialised_saxophone = dodge.obj_to_dict(saxophone)
unserialised_saxophone = dodge.dict_to_obj(serialised_saxophone)
print unserialised_saxophone.material # Prints "brass"
License
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
dodge-0.1.9.tar.gz
(3.9 kB
view details)
File details
Details for the file dodge-0.1.9.tar.gz
.
File metadata
- Download URL: dodge-0.1.9.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e05bdbaf6a98c9bc92a0e3b8d3066bb887fe2e2590e57d47762f4730bd456e1 |
|
MD5 | 6429adaa2dbaf9682a35c443445f14ee |
|
BLAKE2b-256 | ae955efbf0d11ccfe6ade1d0c7d637de1e9a38bd7b73742c14c23d1e6d1ce406 |