Skip to main content

Jsobj provides JavaScript-Style Objects in Python.

Project description

jsobj provides JavaScript-Style Objects in Python. It is based on jsobject, but returns None if you try accessing non-existent keys instead of throwing an exception.

Homepage and documentation: https://github.com/gkovacs/jsobj

Example: “Hello World” with jsobj

from jsobject import Object
data = {
  "boolean": True,
  "null": None,
  "number": 123,
  "objectA": {'a': 'b', 'c': {'d': 'e', 'f': {'g': 'h'}}}
  }

jso = Object(data)

print(jso.boolean)       # True
print(jso.null)          # None
print(jso.number)        # 123
print(jso.objectA)       # {'a': 'b', 'c': {'d': 'e', 'f': {'g': 'h'}}}
print(jso.objectA.a)     # b
print(jso.objectA.c.d)   # e
print(jso.objectA.c.f.g) # h

Installation

$ pip install jsobj

License

MIT

Credits

Geza Kovacs. Based on jsobject by Marcin Wierzbanowski

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

jsobj-1.0.4.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jsobj-1.0.4-py2.py3-none-any.whl (4.3 kB view details)

Uploaded Python 2Python 3

File details

Details for the file jsobj-1.0.4.tar.gz.

File metadata

  • Download URL: jsobj-1.0.4.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for jsobj-1.0.4.tar.gz
Algorithm Hash digest
SHA256 7b2bf229a247ded5b8c6a2778b6615fc0729b3cbfb8756c6f4e9a25d8a045cf6
MD5 051a5cb930ffa93c19f8b23717cf53fa
BLAKE2b-256 eec83475e57bf3935493b7e58842c33cce8dea5c987eab675075dda92ec27cb0

See more details on using hashes here.

File details

Details for the file jsobj-1.0.4-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for jsobj-1.0.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 d0c76386669bbd09191e384f0c92f629ce73a3174b0d12219680b68d55f2d090
MD5 68de139672e521a3c1d33d23f4ae828a
BLAKE2b-256 fc5881868e0bf60141812a7e22735eeb0493ab49af35758e45114fa6f32ed4ba

See more details on using hashes here.

Supported by

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