Convert dictionaries to dataclasses and back
Project description
# howard
Python datatype marshalling
This libary marshalls dictionaries (think json) into instances of defined dataclasses and back.
i.e.
```python
from dataclasses import dataclass
import howard
@dataclass
class Person:
name: str
age: int
my_dict = {'name': 'Bob', 'age': 24}
person = howard.fromdict(my_dict, Person)
assert person.name == 'Bob'
assert person.age == 24
```
to install:
```bash
pip install howard
```
Python datatype marshalling
This libary marshalls dictionaries (think json) into instances of defined dataclasses and back.
i.e.
```python
from dataclasses import dataclass
import howard
@dataclass
class Person:
name: str
age: int
my_dict = {'name': 'Bob', 'age': 24}
person = howard.fromdict(my_dict, Person)
assert person.name == 'Bob'
assert person.age == 24
```
to install:
```bash
pip install howard
```
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
howard-1.0.2.tar.gz
(1.9 kB
view details)
File details
Details for the file howard-1.0.2.tar.gz
.
File metadata
- Download URL: howard-1.0.2.tar.gz
- Upload date:
- Size: 1.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.7.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
cee2aeb7cdeeff28b59210728f041a55131bb8865be20518d3dfb8eceec899a0
|
|
MD5 |
c2559e93af6164c9c4aec596f3caf1d1
|
|
BLAKE2b-256 |
35fb03837d4023ef730b967b0e0bbac6e3680eb5c5047401adcbcf8656b21acb
|