Skip to main content

commentjson

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

https://travis-ci.org/vaidik/commentjson.png

Installation

pip install commentjson

Basic Usage

>>> import commentjson
>>>
>>> json_string = """{
...     "name": "Vaidik Kapoor", # Person's name
...     "location": "Delhi, India", // Person's location
...
...     # 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

License

See license.

Metadata

Release files for commentjson 0.7.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for commentjson 0.7.1
File Size Uploaded Provenance Actions
commentjson-0.7.1.tar.gz 4.1 kB Without provenance Details for commentjson-0.7.1.tar.gz

Release files / commentjson-0.7.1.tar.gz

Download URL commentjson-0.7.1.tar.gz
Size 4.1 kB
Tags Source
SHA-256 checksum
How to use checksums
fe7979ed10ad5f859c53827b22c268d77113d8ad4dc2cddc2b4daaa1294168c9
BLAKE2b-256 checksum
How to use checksums
81639fafac8fb75d153deec7dee7c255905fe5e44d73e6c6788dc848bb53cc97
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for commentjson 0.7.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page