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 hashes)