Annotate your Python dict
Project description
anodict: annotated dict
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
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
anodict-0.0.2.tar.gz
(3.1 kB
view details)
Built Distribution
File details
Details for the file anodict-0.0.2.tar.gz
.
File metadata
- Download URL: anodict-0.0.2.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 94760765010a6cf5a15a9127875f83bc83d9aacdfdec8e74ef128b1b17e39a92 |
|
MD5 | baf7428bb51319ad49b15ede556c563b |
|
BLAKE2b-256 | 4835002887314d7ddde34aae916d444c992be6fd5bea8d90836ee377417d67b8 |
File details
Details for the file anodict-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: anodict-0.0.2-py3-none-any.whl
- Upload date:
- Size: 3.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 394707e141b1d9a28a90f3ce68b6d6c8d28f01168e53a9726f68cb3d79060bd9 |
|
MD5 | 7e34c0e3c9b5ae4972ef5051f4eae753 |
|
BLAKE2b-256 | 9cdb5e7bb6e157eeb59b45961b48840555ecb8d2902904e233be42d0dcb9598c |