jstyleson
Library to parse JSON with js-style comments.
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 jstylesonuv
uv add jstylesonpoetry
poetry add jstylesonInstalling 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
Tags
More Text Processing packages
A drop-in replacement for Python's standard…
permissive · top 100 on PyPI
pyparsingpyparsing provides a library for building text…
permissive · top 1,000 on PyPI
docutilsDocutils converts plaintext documentation in…
unclear · top 1,000 on PyPI
RapidFuzzRapidFuzz provides fast fuzzy string matching…
permissive · top 1,000 on PyPI
tinycss2tinycss2 parses CSS strings into token and…
permissive · top 1,000 on PyPI
llama-parseLlamaParse parses complex documents (PDFs,…
permissive · top 1,000 on PyPI
jsoncommentParses JSON with comments, multiline strings,…
permissive · top 15,000 on PyPI
json-with-commentsParses and serializes JSON with support for…
permissive · top 15,000 on PyPI
JSON_minifyMinifies JSON by removing whitespace and…
permissive · top 15,000 on PyPI
json5kitParses JSON5 (JSON with comments, trailing…
permissive · top 15,000 on PyPI
add-trailing-commaAutomatically adds trailing commas to…
permissive · top 15,000 on PyPI
json5Parses and writes JSON5 data format, which…
permissive · top 1,000 on PyPI
commented-configparserExtends Python's standard ConfigParser to…
permissive · top 15,000 on PyPI
flake8-commasA flake8 plugin that enforces trailing comma…
permissive · top 15,000 on PyPI
json2htmlConverts JSON data structures into HTML tables…
permissive · top 5,000 on PyPI
ast-commentsExtends Python's built-in `ast` module to…
permissive · top 15,000 on PyPI