--- id: dirtyjson version: "1.0.8" license: MIT License license_treatment: permissive maintenance: abandoned --- # dirtyjson — JSON decoder for Python that can extract data from the muck License: permissive · Maintenance: abandoned · Downloads: 11.6M/mo ## What it is and what it does dirtyjson is a JSON decoder that reads JSON-like data from files violating the official JSON standard. It accepts single quotes, line and inline comments, dangling commas, unquoted single-word keys, and hexadecimal/octal number literals. The parser returns Python objects wrapped in AttributedDict and AttributedList subclasses that preserve line and column position metadata for every element, allowing you to map results back to source locations. The package is designed for extracting structured data from JavaScript files or other sources where strict JSON compliance is not guaranteed. It exposes a familiar API similar to the standard library's json module, offering load() and loads() functions but no write capability. Position tracking makes it useful for building error messages or source-aware parsers that need to report exactly where in the original file a problem occurred. Use it for: - Extract configuration objects from JavaScript files that use unquoted keys or trailing commas. - Parse JSON responses from APIs or data files that include comments or non-standard syntax. - Build a linter or code analyzer that needs to report errors with precise line and column references. - Read JSON-like data embedded in source code where strict compliance is impractical. - Migrate legacy systems that generate or consume non-standard JSON variants. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Parses JSON-like data from files containing syntax violations—single quotes, comments, unquoted keys, dangling commas, and hex/octal numbers—while tracking line and column positions for each element. Yes, if you need to parse non-standard JSON and can tolerate abandoned maintenance. The package is stable, has no dependencies, and works reliably for its core purpose. However, do not install if you require active bug fixes, security updates, or support for future Python versions—the last commit was 2022-11-28 and the project shows no signs of revival. For new projects, consider whether standard JSON with preprocessing might be more maintainable. ## Install pip install dirtyjson uv add dirtyjson poetry add dirtyjson ## Installing dirtyjson Before you install: Low friction: pure Python wheel with no runtime dependencies. Maintenance is inactive—last commit was 2022-11-28 and shows no recent activity. Suitable for stable, read-only use cases but not for active development or bug fixes. License in practice: Dual-licensed under MIT License and Academic Free License (AFL), both permissive. You may use, modify, and distribute freely in proprietary or open-source projects with minimal restrictions. Quickstart: import dirtyjson data = dirtyjson.loads("[\"foo\", /* comment */ {bar: ['baz', null, 1.0, 2,]}]") print(data) pos = data.attributes(0) print(pos.line, pos.column) Verify before relying: - Whether the package handles modern Python versions beyond 3.10 without issues given abandoned maintenance status. - Performance characteristics when parsing very large or deeply nested JSON-like structures. - Compatibility with recent versions of PyPy if that is a deployment target. ## Package facts - License: MIT License (permissive) - Python support: unspecified - Install friction: low - Maintenance: abandoned - Downloads: 11.6M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags lenient json parser, json with comments, parse malformed json, dirty json decoder, javascript object extraction, json position tracking, relaxed json parsing, json-parsing, position-tracking, lenient-parsing [View on SkillFed](https://skillfed.io/packages/dirtyjson) · [View on PyPI](https://pypi.org/project/dirtyjson/)