Wrapper module to provide a simple property accessor for JSON objects.
Project description
JSONobj
JSONobj is a Python module for providing attribute-like access to the properties of JSON objects.
Requirement
- Python 2.7 or above
Installation
pip install jsonobj
Basic Usage
>>> import jsonobj
>>> obj = jsonobj.loads('{"prop1": "value"}')
>>> obj.prop1
'value'
>>> obj.prop1 = 'changed'
>>> obj.prop2 = ['foo', 'bar', {'fiz': 'buz'}]
>>> 'prop2' in obj
True
>>> obj.dict
{'prop1': 'changed', 'prop2': ['foo', 'bar', {'fiz': 'buz'}]}
>>> obj.prop2[2].fiz
'buz'
>>> del obj.prop1
>>> jsonobj.dumps(obj)
'{"prop2": ["foo", "bar", {"fiz": "buz"}]}'
Documentation
Documentation is available online.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
jsonobj-0.1.0.tar.gz
(3.1 kB
view hashes)
Built Distribution
Close
Hashes for jsonobj-0.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 226105e24bf45b528d4ad7ba32f06ba2c7655df2f8ffa20fb14eea0c74cb7b6c |
|
MD5 | a2e341482306437d5cb802be1c24be63 |
|
BLAKE2b-256 | 2c7fa890c5aa2fa768e16964f5657c055ad38d0f14b37ca8a090e872b6766e34 |