Skip to main content

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

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.6.tar.gz (3.7 kB view details)

Uploaded Source

File details

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

File metadata

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

File hashes

Hashes for commentjson-0.2.6.tar.gz
Algorithm Hash digest
SHA256 afe39033c12603814821f3cc93ce3ae94c3b56f1b15ac7446d6b07366a3d95de
MD5 3969b7e5aa40801ff63b2ec47ffd7034
BLAKE2b-256 a9bcfdedaa3fc5d164c734c68b06ec5c742b6fff3ff3ba50227ecdd729713b01

See more details on using hashes here.

Release history Release notifications | RSS feed

0.9.0

1 file

0.8.3

1 file

0.8.2

1 file

0.8.1

1 file

0.8.0

1 file

0.7.2

1 file

0.7.1

1 file

0.6

1 file

0.5

1 file

0.4

1 file

0.3

1 file

This release

0.2.6 This release

1 file

0.2.5

1 file

0.2.4

1 file

0.2.2

1 file

0.2.1

1 file

0.2

1 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