A simple package which converts a standard python dictionary to a dot accessible object.
Project description
DotConfig
A simple package which converts a standard python dictionary to a dot accessible configuration object.
Installation
pip install dotcon
Usage
from dotcon import DotConfig
mydict = {
"A": [1, 2, 3, 4],
"B": {"C": 5},
"D": "E",
"F": None,
}
ddict = DotConfig(mydict)
ddict.A
>>> [1, 2, 3, 4]
# Or the regular way
ddict['A']
>>> [1, 2, 3, 4]
ddict.B
>>> {"C": 5}
ddict.B.C
>>> 5
ddict.D
>>> "E"
ddict.F
>>> None
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
dotcon-0.5.1.tar.gz
(2.5 kB
view hashes)
Built Distribution
dotcon-0.5.1-py3-none-any.whl
(2.8 kB
view hashes)