Skip to main content

make iter object easy to access (item to attr)

Project description

Oba

PyPI GitHub

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)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page