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.6.tar.gz
(2.0 kB
view details)
File details
Details for the file oba-0.0.6.tar.gz
.
File metadata
- Download URL: oba-0.0.6.tar.gz
- Upload date:
- Size: 2.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a5096d444f00a078045a465cf46b86c0759da5e977ea4129d25ffd5dd358bc0 |
|
MD5 | 3bdbe348d7dbd2eefc1b46a784562ee5 |
|
BLAKE2b-256 | 9709c377e75b48f38409abaa18fe1c05853fed7636c3bd4221e1aff7d9ace929 |