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.fromdict(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.0.3.tar.gz (1.9 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: howard-1.0.3.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

Hashes for howard-1.0.3.tar.gz
Algorithm Hash digest
SHA256 1b9ec3a2fa65e48b878494ba68ff1517f1debcc91e533692b13a5ae94e54a67e
MD5 312f1c2d793026ee022d4be8b340e3db
BLAKE2b-256 233caeff633afcd348fcc35a2eb880a3846a184006d1cf6ac3d67ef555232409

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