Skip to main content

A wrapper to JSON parsers allowing comments and multi line strings

Project description

A wrapper to JSON parsers allowing comments and multi line strings


Dependencies

Python 2.7, 3.3

Optional

ujson 1.30+


Description

This package allows to parse JSON files or strings with comments and multi line strings.


Comments

  • # and ; are for single line comments
  • /* and */ enclose multi line comments

Inline comments are not supported


Multi line strings

Any string can be multi line, even object keys.

  • Multi strings start and end with """, like in python
  • The preprocessor merges all lines to a single standard string
  • No edge space or new line is kept. To hard code new lines in the string, use \\\n

Notes

JSON Comment works with any JSON parser which supports “load” and “loads”, by adding a preprocessor to these calls.


Usage

Install

python setup.py install

Examples

Added in the examples directory


Contact

Dando Real ITA @ Steam Profile

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for jsoncomment, version 0.1.1
Filename, size File type Python version Upload date Hashes
Filename, size jsoncomment-0.1.1.zip (6.8 kB) File type Source Python version None Upload date Hashes View
Filename, size jsoncomment-0.1.1.win-amd64.exe (229.8 kB) File type Windows Installer Python version any Upload date Hashes View
Filename, size jsoncomment-0.1.1.win32.exe (203.7 kB) File type Windows Installer Python version any Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page