Skip to main content

Add Python style comments in your JSON files.

Project description

commentjson (Comment JSON) is a Python package that helps you create JSON files with comments. Its API is very similar to the Python standard library’s json module.

Installation

pip install commentjson

Basic Usage

>>> import commentjson
>>>
>>> json_string = """{
...     "name": "Vaidik Kapoor", # Person's name
...     "location": "Delhi, India",
...
...     # Section contains info about person's appearance
...     "appearance": {
...         "hair_color": "black",
...         "eyes_color": "black",
...         "height": "6"
...     }
... }"""
>>>
>>> json_loaded = commentjson.loads(json_string)
>>> print json_loaded
{u'appearance': {u'eyes_color': u'black', u'hair_color': u'black', u'height': u'6'}, u'name': u'Vaidik Kapoor', u'location': u'Delhi, India'}

Documentation

Complete documentation can be found here.

Tests

python setup.py test

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

commentjson-0.2.5.tar.gz (3.5 kB view details)

Uploaded Source

File details

Details for the file commentjson-0.2.5.tar.gz.

File metadata

  • Download URL: commentjson-0.2.5.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for commentjson-0.2.5.tar.gz
Algorithm Hash digest
SHA256 88e4636af32d911ba59994a0f7487d0f0f1881c9a1d29ced72c600aadf6e65db
MD5 e03376354073307af43076ce34a1e840
BLAKE2b-256 327cf274e203502d6fa212ee1376a2df12a8b0fa9039124ee6c58b1197e262da

See more details on using hashes here.

Provenance

Supported by

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