Skip to main content

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


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 details)

Uploaded Source

Built Distribution

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

jsonobj-0.1.0-py2.py3-none-any.whl (4.0 kB view details)

Uploaded Python 2Python 3

File details

Details for the file jsonobj-0.1.0.tar.gz.

File metadata

  • Download URL: jsonobj-0.1.0.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.7

File hashes

Hashes for jsonobj-0.1.0.tar.gz
Algorithm Hash digest
SHA256 cc8e53dabcdd09bdf4ed2593844d500ab0206c2a299baadc7bf3210d664c0332
MD5 bea64f6c12648218fd8db4fdfd27a3df
BLAKE2b-256 97cbe124fce03f1a43dc29c23f57f38d75410235b6cf8f5b0f90d96e826c1dc9

See more details on using hashes here.

File details

Details for the file jsonobj-0.1.0-py2.py3-none-any.whl.

File metadata

  • Download URL: jsonobj-0.1.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.7

File hashes

Hashes for jsonobj-0.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 226105e24bf45b528d4ad7ba32f06ba2c7655df2f8ffa20fb14eea0c74cb7b6c
MD5 a2e341482306437d5cb802be1c24be63
BLAKE2b-256 2c7fa890c5aa2fa768e16964f5657c055ad38d0f14b37ca8a090e872b6766e34

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