Skip to main content

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.2.tar.gz (1.9 kB view details)

Uploaded Source

File details

Details for the file oba-0.0.2.tar.gz.

File metadata

  • Download URL: oba-0.0.2.tar.gz
  • Upload date:
  • Size: 1.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for oba-0.0.2.tar.gz
Algorithm Hash digest
SHA256 2d8ae3704196149331108227816a9b741eb1259379bb153d86b722239b7b33c6
MD5 c2a3c44b55d3f299924ae95483d95e5d
BLAKE2b-256 5e2c69af8861958a288a603c7672c92a3d4d77d8239a1b7e8b09752b01e6635b

See more details on using hashes here.

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