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']
}
}
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.3.tar.gz
(1.7 kB
view hashes)
Built Distribution
Close
Hashes for dict_wrapper-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 09663424667d043edfd16900074695f52d467c3f8951e0cd340d9ff4887211fe |
|
MD5 | 429f7d361fcac2e15e5f011f9227d2cb |
|
BLAKE2b-256 | 30b2008f8e5505bf50a1eb760cb356839904cff1d2a76af233398d1f5c9492db |