A userful package to use '.' to visit value of dict
Project description
dict_wrapper
user DictWrapper to visit the value like an object
Installing
Install and update using pip:
pip install -U dict_wrapper
A Simple Example
.. code-block:: python
from dict_wrapper import DictWrapper
data = {
"who": 'your name',
"area": ['specify', 'china'],
"province": {
"city": ['shenzhen', 'guangzhou']
},
"citys":[{
"name":"shenzhen",
"othername":"鹏城"
}]
}
config, config1 = DW(data), DictWrapper(data)
assert config.who == 'your name'
assert config.province.city == ['shenzhen', 'guangzhou']
print(config.area)
print(config1.citys[0].name)
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
dict_wrapper-0.0.4.tar.gz
(6.1 kB
view details)
Built Distributions
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
dict_wrapper-0.0.4-py3.8.egg
(3.5 kB
view details)
File details
Details for the file dict_wrapper-0.0.4.tar.gz.
File metadata
- Download URL: dict_wrapper-0.0.4.tar.gz
- Upload date:
- Size: 6.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5a832bccb4f8ef4f773c90c71ffda601d684905b5ee16e09a2fd543046596bcd
|
|
| MD5 |
893da4e3658994c31c46d88590d03f3c
|
|
| BLAKE2b-256 |
d370e8d6b88417622752d487c58ae3b89ffb187d2fbf592a468d112c1190b953
|
File details
Details for the file dict_wrapper-0.0.4-py3.8.egg.
File metadata
- Download URL: dict_wrapper-0.0.4-py3.8.egg
- Upload date:
- Size: 3.5 kB
- Tags: Egg
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1c8e88eff5a97b01d0076a401cadc606cc838bc13c732d201fdcfbe4de6b42db
|
|
| MD5 |
c3ae1438ad3f8fe9af48dc4d14975806
|
|
| BLAKE2b-256 |
489112aa4d5261b86c18cc33b5ae1e11bf6ac5b61094b3274f5aafd61d02f7f7
|
File details
Details for the file dict_wrapper-0.0.4-py3-none-any.whl.
File metadata
- Download URL: dict_wrapper-0.0.4-py3-none-any.whl
- Upload date:
- Size: 6.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
754e09db72c890f9c3f6293011281a5d56ceaa415f7c67f5a538875591b8e4c5
|
|
| MD5 |
d4265d00bf162c6c1b6e634a2bc082d2
|
|
| BLAKE2b-256 |
a7e52a8a9eef7e33278dddc26be7efbfee37e027cf64a934642e69fa1762945d
|