skillfed

jsoncomment

A wrapper to JSON parsers allowing comments, multiline strings and trailing commas

jsoncomment v0.4.2 136.1K downloads/30d#11,403 on PyPI
Permissive license MIT Abandoned released

What it is and what it does

jsoncomment is a preprocessor wrapper that extends any JSON parser (including the standard library's json module) to accept comments, multiline strings, and trailing commas—features that standard JSON does not allow. It works by stripping comments and normalizing syntax before passing the cleaned input to your chosen JSON parser's load() or loads() methods.

The package supports single-line comments using #, ;, or //, multiline comments with /* */, and triple-quoted multiline strings similar to Python. It also provides convenience methods like loadf() to load JSON files with a fallback default value and dumpf() to save JSON with indentation. However, the project has been abandoned since 2019-02-08 with no active maintenance, which means it will not receive updates for compatibility with newer Python versions or security issues.

Use it for:

  • Load configuration files that contain comments and trailing commas without manual preprocessing
  • Parse JSON-like data formats in legacy systems or custom file formats that tolerate relaxed JSON syntax
  • Preprocess JSON strings in scripts where you want to add inline documentation without breaking parsing
  • Work with existing codebases already using jsoncomment where replacement is not feasible

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Parses JSON with comments, multiline strings, and trailing commas by preprocessing input before passing it to any standard JSON parser.

No. While the package is permissive (MIT) and has low install friction, it is abandoned (last release 2019-02-08) with no active maintenance. For new projects, use a maintained alternative. For legacy systems already using jsoncomment, it may continue to work on Python 3.3+, but you assume all maintenance risk and will receive no security updates.

Install

jsoncomment on PyPI

pip

pip install jsoncomment

uv

uv add jsoncomment

poetry

poetry add jsoncomment

Installing jsoncomment

Before you install

Low install friction as a pure-Python wheel with one runtime dependency (json-spec). However, the package is abandoned—last release was 2019-02-08. No active maintenance or security updates.

License in practice

MIT license is permissive; you can use, modify, and distribute this package freely with minimal restrictions, making it safe from a licensing perspective.

Quickstart

pip install jsoncomment

from jsoncomment import JsonComment

json = JsonComment()
json_obj = json.loads('[1, 2, 3,]  # trailing comma')

Requires Python 3.3 or later. Comments must be preceded only by whitespace on the same line; inline comments are not supported.

Verify before relying

  • Whether json-spec dependency is actively maintained and compatible with current Python versions
  • Real-world compatibility with modern JSON parsers beyond the standard library json module
  • Whether the package works reliably with modern Python versions despite being marked abandoned since 2019-02-08

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.3)
Install friction low — pure-Python wheel
Runtime dependencies 1 — json-spec
Maintenance abandoned — 2,744 days since the last release
First released
Downloads 136,149/month — #11,403 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: jsoncomment-0.4.2-py3-none-any.whl

Keywords: json, comments, multiline

Development Status :: 4 - BetaIntended Audience :: End Users/DesktopLicense :: OSI Approved :: MIT LicenseNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3.3Topic :: Software Development :: Pre-processorsTopic :: Text Editors :: Text Processing

Tags

json with commentsparse json commentsjson preprocessorjson trailing commasmultiline json stringsjson comment parsercommented json files
json-parsingconfig-filesabandoned

More Pre-processors packages