Skip to main content

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.

from dataclasses import dataclass

import howard

@dataclass
class Person:
    name: str
    age: int


my_dict = {'name': 'Bob', 'age': 24}
person = howard.from_dict(my_dict, Person)
assert person.name == 'Bob'
assert person.age == 24

to install:

pip install howard

Project details


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.6.0.tar.gz (2.9 kB view details)

Uploaded Source

File details

Details for the file howard-1.6.0.tar.gz.

File metadata

  • Download URL: howard-1.6.0.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.20.1 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.3

File hashes

Hashes for howard-1.6.0.tar.gz
Algorithm Hash digest
SHA256 4fa873aa2c46c1d24fe9c5d3bad0313f55ec96be82d1036dd7cee6ab86b94ed4
MD5 733c2f48e6e7c805387759f34c895772
BLAKE2b-256 fbd4f46fd9c73c045ab351fe6e50968e85d5a450c4e6c5b2e45c257625dde3b3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page