Add Python style comments in your JSON files.
Project description
# commentjson
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][json] module.
[json]: http://docs.python.org/2/library/json.html
## Installation
` pip install commentjson `
## Basic Usage
`python >>> 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'} `
## Tests
` python setup.py test `
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file commentjson-0.2.1.tar.gz.
File metadata
- Download URL: commentjson-0.2.1.tar.gz
- Upload date:
- Size: 3.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
89ed838a56af505f06bdeed54e46dbeff24f82799ea591e9ac8ff1ef123f9717
|
|
| MD5 |
78852928ba906a3757603dedecf5b83d
|
|
| BLAKE2b-256 |
445bb2035350121df7b38cf83eba69e71905f204825f0a6e5561d7ceb407c3dd
|