--- id: json-with-comments version: "1.2.10" license: MIT license_treatment: permissive maintenance: active --- # json-with-comments — JSON with Comments (jsonc) for Python License: permissive · Maintenance: active · Downloads: 136.9K/mo ## What it is and what it does json-with-comments is a Python library that extends JSON parsing to handle comments and trailing commas—features common in configuration files but not part of the JSON specification. It provides load/loads functions that strip single-line (//) and block (/* */) comments before parsing, and dump/dumps functions that can add comments and trailing commas when serializing. The package has no external dependencies and supports Python 3.7 through 3.13 on both CPython and PyPy. Use it when you need to read or write JSON-like configuration files that include comments, or when working with JSONC format commonly found in configuration tools. Use it for: - Parse configuration files in JSONC format that include comments and trailing commas. - Strip comments from JSON during a preprocessing step before passing to strict JSON parsers. - Serialize Python objects to JSON while preserving or adding explanatory comments for readability. - Handle hand-edited JSON files that developers have annotated with trailing commas and comments. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Parses and serializes JSON with support for single-line and block comments, plus trailing commas in arrays and objects. Yes. The package is actively maintained, has no dependencies, installs easily, carries a permissive MIT license, and solves a real problem for anyone working with JSONC files or commented JSON. No known vulnerabilities. Install it if you need to parse or generate JSON with comments. ## Install pip install json-with-comments uv add json-with-comments poetry add json-with-comments ## Installing json-with-comments Before you install: Low friction: pure Python wheel, no runtime dependencies, and actively maintained with a recent commit on 2026-08-07. License in practice: MIT license is permissive; you can use this package freely in commercial and private projects with minimal restrictions. Quickstart: pip install json-with-comments import json_with_comments result = json_with_comments.loads('{"key": "value" /* comment */}') print(result) Verify before relying: - Whether dump/dumps comment-addition features work with arbitrary Python objects or only specific types. - Performance characteristics when parsing large JSON files with extensive comments. - How the module's import name relates to the package name json-with-comments. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 136.9K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags json with comments parser, jsonc python, json comments support, trailing commas json, strip comments from json, json comment removal, json-parsing, configuration [View on SkillFed](https://skillfed.io/packages/json-with-comments) · [View on PyPI](https://pypi.org/project/json-with-comments/)