Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vaidik/commentjson
Add JavaScript or Python style comments in JSON.
https://github.com/vaidik/commentjson
Last synced: 27 days ago
JSON representation
Add JavaScript or Python style comments in JSON.
- Host: GitHub
- URL: https://github.com/vaidik/commentjson
- Owner: vaidik
- License: mit
- Created: 2013-09-10T13:25:28.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2024-06-24T12:50:35.000Z (6 months ago)
- Last Synced: 2024-11-08T00:18:57.052Z (about 1 month ago)
- Language: Python
- Homepage:
- Size: 71.3 KB
- Stars: 104
- Watchers: 8
- Forks: 25
- Open Issues: 11
-
Metadata Files:
- Readme: README.rst
- License: LICENSE.rst
Awesome Lists containing this project
- starred-awesome - commentjson - Add JavaScript or Python style comments in JSON. (Python)
README
===========
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... _`json`: http://docs.python.org/2/library/json.html
.. image:: https://travis-ci.org/vaidik/commentjson.png
Installation
============pip install commentjson
Basic Usage
===========.. code-block:: python
>>> 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`_.
.. _`here`: http://commentjson.readthedocs.org/en/latest/
Tests
=====python setup.py test
License
=======See `license`_.
.. _`license`: https://github.com/vaidik/commentjson/blob/master/LICENSE.rst