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
Release files for jsobj 1.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| jsobj-1.0.4.tar.gz | 3.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| jsobj-1.0.4-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
Total release size: 8.2 kB
Release files / jsobj-1.0.4.tar.gz
| Download URL | jsobj-1.0.4.tar.gz |
|---|---|
| Size | 3.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7b2bf229a247ded5b8c6a2778b6615fc0729b3cbfb8756c6f4e9a25d8a045cf6
|
|
BLAKE2b-256 checksum How to use checksums |
eec83475e57bf3935493b7e58842c33cce8dea5c987eab675075dda92ec27cb0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / jsobj-1.0.4-py2.py3-none-any.whl
| Download URL | jsobj-1.0.4-py2.py3-none-any.whl |
|---|---|
| Size | 4.3 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
d0c76386669bbd09191e384f0c92f629ce73a3174b0d12219680b68d55f2d090
|
|
BLAKE2b-256 checksum How to use checksums |
fc5881868e0bf60141812a7e22735eeb0493ab49af35758e45114fa6f32ed4ba
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |