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

Uploaded Source

File details

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

File metadata

  • Download URL: howard-1.2.0.tar.gz
  • Upload date:
  • Size: 2.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.20.1 setuptools/41.2.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.7.4

File hashes

Hashes for howard-1.2.0.tar.gz
Algorithm Hash digest
SHA256 fd338e8b8111d8203173404bf32f95c2a1cf1844c8ca410dba8c9b9e122fca48
MD5 10664b6c1dfb8f8415d49951150799c0
BLAKE2b-256 250311f1fd5ff0b30493e813e70ce6845a6799ca7234ab3e7aca2a43a29f1272

See more details on using hashes here.

Supported by

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