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.2

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.2
File Size Uploaded
commentjson-0.7.2.tar.gz 4.3 kB Details

Release files / commentjson-0.7.2.tar.gz

Download URL commentjson-0.7.2.tar.gz
Size 4.3 kB
Tags Source
SHA-256 checksum
How to use checksums
2916e54695241bb9e4342203c3f643efaff6d53807d72102161dbd5449f54dbd
BLAKE2b-256 checksum
How to use checksums
c23428ce934ab8f84d928152f22c29fca1e23d2826b45e4ae41a921958b14897
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Python-urllib/3.7

Release history Release notifications | RSS feed

0.9.0

1 release file

0.8.3

1 release file

0.8.2

1 release file

0.8.1

1 release file

0.8.0

1 release file

This release

0.7.2 This release

1 release file

0.7.1

1 release file

0.6

1 release file

0.5

1 release file

0.4

1 release file

0.3

1 release file

0.2.6

1 release file

0.2.5

1 release file

0.2.4

1 release file

0.2.2

1 release file

0.2.1

1 release file

0.2

1 release file

0.1

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