Skip to content

keuin/anodict

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

anodict: annotated dict

Pyversions

Convert a dict to an annotated object.

Usage

Installation

pip install anodict

Example

import anodict


class Person:
    name: str
    age: int

person = anodict.dict_to_class({
    "name": "bob",
    "age": 23
}, Person)

print("type:", type(person))
print("name:", person.name)
print("age:", person.age)

will give:

type: <class '__main__.Person'>
name: bob
age: 23

About

Annotated Python dict.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages