Convert dict to (js)object
Project description
dict2object
dict2object is a dictionary that supports attribute-style access, a la JavaScript
Install
pip install dict2object-gaponukz
Use
from dict2object.dict2object import Object
user1 = Object(
name="Adam",
age = 18,
)
user2 = Object({
"name": "Max",
"age": 18,
"job": {
"name": "developer",
"experience": 3
}
})
user3 = user2.copy()
user3.job.name = "full stack developer"
print(user3)
user4 = Object.load('{"name": "Anna", "age": 20}')
user4.job = user3.job
print(user4)
Requirements
- python >= 3.8
You can use dict2object
with python 3.8.
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
Built Distribution
Close
Hashes for dict2object-gaponukz-0.0.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 415347c2070f11f7710a71f058b8296d6cd6e9a9f3fad162fd1758e3e95fa3bd |
|
MD5 | 1d88f712348f3077f6e0d3e7daac45c9 |
|
BLAKE2b-256 | 87384982824ce519d1dec2aa2bd7b9682b21ee07305ff7a878cd9e8419681d8d |
Close
Hashes for dict2object_gaponukz-0.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 02750431ebf2cd0c6b45d4cc39a114e7be86754735e6d7629dc309428b130ab3 |
|
MD5 | 55ca82fff14a49a9cabb85c011bf7257 |
|
BLAKE2b-256 | 10624887300f23df54ae56da5478222124e5cbdb7a4de4f0fb4bc16fd8c99288 |