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
data = {
"who": 'your name',
"area": ['specify', 'china'],
"province": {
"city": ['shenzhen', 'guangzhou']
}
}
config = DictWrapper(data)
assert config.who == 'your name'
assert config.province.city == ['shenzhen', 'guangzhou']
print(config.area)
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.2.tar.gz
(1.4 kB
view hashes)
Built Distribution
Close
Hashes for dict_wrapper-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5c784f4b30800e28394a1b1d729800813135f56485bd9adcff64b69271df5f87 |
|
MD5 | f9a0f0779d7b0646aaf7aac02c367582 |
|
BLAKE2b-256 | ebe145895f9dd646312b8c2c9d8957be4c5240274dcefa145f0703b00dfde7ac |