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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7b2bf229a247ded5b8c6a2778b6615fc0729b3cbfb8756c6f4e9a25d8a045cf6
|
|
| MD5 |
051a5cb930ffa93c19f8b23717cf53fa
|
|
| BLAKE2b-256 |
eec83475e57bf3935493b7e58842c33cce8dea5c987eab675075dda92ec27cb0
|
File details
Details for the file jsobj-1.0.4-py2.py3-none-any.whl.
File metadata
- Download URL: jsobj-1.0.4-py2.py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d0c76386669bbd09191e384f0c92f629ce73a3174b0d12219680b68d55f2d090
|
|
| MD5 |
68de139672e521a3c1d33d23f4ae828a
|
|
| BLAKE2b-256 |
fc5881868e0bf60141812a7e22735eeb0493ab49af35758e45114fa6f32ed4ba
|