skillfed

jstyleson

Library to parse JSON with js-style comments.

jstyleson v0.0.2 541.4K downloads/30d#6,095 on PyPI41
Permissive license MIT Abandoned released

What it is and what it does

jstyleson is a lightweight wrapper around Python's standard json module that preprocesses JSON strings to strip out JavaScript-style comments and trailing commas before parsing. It solves the problem of parsing informal JSON that includes single-line comments (//), multi-line comments (/* */), inline comments, and trailing commas—none of which the standard library supports. The package works by removing these elements via a dispose function, then passing the cleaned string to json.loads().

The package has no external runtime dependencies and is straightforward to use: call jstyleson.loads() instead of json.loads() on your commented JSON string. However, it has been abandoned since 2016 and was only ever marked as Alpha. It was tested only against Python 2.7 and 3.5, and there is no evidence of maintenance or compatibility verification for modern Python versions.

Use it for:

  • Parsing configuration files in JSON format that developers have annotated with comments for clarity.
  • Loading JSON exported from JavaScript environments that may include trailing commas or comments.
  • Preprocessing user-provided JSON that doesn't strictly conform to the JSON standard but is otherwise valid.
  • Migrating legacy systems that store configuration in commented JSON to Python without rewriting the source files.

Worth the install?

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

Parses JSON strings that contain JavaScript-style comments (single-line, multi-line, and inline) and trailing commas, which the standard library json module cannot handle.

No. The package is abandoned (last update 2021, no commits since), marked as Alpha, and has not been verified against Python versions beyond 3.5. While the core functionality is simple and there are no known vulnerabilities, the lack of maintenance and unclear compatibility with modern Python make it a poor choice for new projects. Consider using a maintained alternative or preprocessing JSON externally if you need comment support.

Install

jstyleson on PyPI

pip

pip install jstyleson

uv

uv add jstyleson

poetry

poetry add jstyleson

Installing jstyleson

Before you install

High install friction: package is abandoned (last commit 2021-07-13, 3706 days since release), marked as Alpha development status, and has not been updated since its initial 2016 release. No runtime dependencies, but the lack of maintenance is a significant concern for long-term use.

License in practice

MIT license is permissive and imposes minimal restrictions—you can use, modify, and distribute this code freely as long as you include the original license notice. No compatibility issues with most projects.

Quickstart

pip install jstyleson

import jstyleson
invalid_json = '{"foo": "bar", // comment\n}'
result = jstyleson.loads(invalid_json)

Package is abandoned and untested against modern Python versions; classifiers list only Python 2.7 and 3.5 support.

Verify before relying

  • Whether the package works reliably with Python versions beyond 3.5 (no explicit requires_python constraint given).
  • Whether edge cases in comment/trailing-comma removal are handled correctly (no recent test coverage or bug reports visible).
  • Performance characteristics on large JSON files with complex comment patterns.

Package facts

License MIT (permissive)
Python support not specified
Install friction high — source build required
Runtime dependencies none
Maintenance abandoned — 3,706 days since the last release
Last repo commit
First released
Downloads 541,427/month — #6,095 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: jstyleson-0.0.2.tar.gz

Keywords: json, comment, javascript, parse

Development Status :: 3 - AlphaLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 2.7Programming Language :: Python :: 3.5

Tags

json with comments parserjavascript style json parsingjson trailing comma supportparse commented jsonjson comment removalrelaxed json parserjson preprocessor
json-parsingabandoned

More Text Processing packages