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.1.tar.gz
(1.8 kB
view details)
File details
Details for the file howard-1.0.1.tar.gz
.
File metadata
- Download URL: howard-1.0.1.tar.gz
- Upload date:
- Size: 1.8 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 | ec3826c8198f714779f75c95945bae41d897119b1086b6c35823693d32ceae03 |
|
MD5 | c18d84666e8306b859080b86b1176f7e |
|
BLAKE2b-256 | 8513a0d2e814eae2738f4417672e1fdb4cb51980d8ed8c1136bb511b5d37e2f3 |