make iter object easy to access (item to attr)
Project description
Oba
Usage
- Convert iterative object to attribute-accessible object
Install
pip install oba
Description
from oba import Obj
o = Obj(dict(a=[1, 2, 3], b=[4, dict(x=1)], c=dict(l='hello')))
print(o.a[2]) # => 3
print(o.c.l) # => hello
o.b[1].x = 4
print(Obj.raw(o.b[1])) # => {'x': 4}
print(bool(o.xxx)) # => False, accessible as NoneObj()
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
oba-0.0.8.tar.gz
(3.0 kB
view hashes)