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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dict2object-gaponukz-0.0.5.tar.gz.
File metadata
- Download URL: dict2object-gaponukz-0.0.5.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/1.5.0 colorama/0.4.4 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
415347c2070f11f7710a71f058b8296d6cd6e9a9f3fad162fd1758e3e95fa3bd
|
|
| MD5 |
1d88f712348f3077f6e0d3e7daac45c9
|
|
| BLAKE2b-256 |
87384982824ce519d1dec2aa2bd7b9682b21ee07305ff7a878cd9e8419681d8d
|
File details
Details for the file dict2object_gaponukz-0.0.5-py3-none-any.whl.
File metadata
- Download URL: dict2object_gaponukz-0.0.5-py3-none-any.whl
- Upload date:
- Size: 3.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.26.7 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/1.5.0 colorama/0.4.4 CPython/3.10.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
02750431ebf2cd0c6b45d4cc39a114e7be86754735e6d7629dc309428b130ab3
|
|
| MD5 |
55ca82fff14a49a9cabb85c011bf7257
|
|
| BLAKE2b-256 |
10624887300f23df54ae56da5478222124e5cbdb7a4de4f0fb4bc16fd8c99288
|