--- id: json-source-map version: "1.0.5" license: unclear license_treatment: permissive maintenance: dormant --- # json-source-map — Calculate the source map for a JSON document. License: permissive · Maintenance: dormant · Downloads: 374.0K/mo ## What it is and what it does json-source-map is a Python library that parses JSON and produces a detailed source map: for each value in the document, it records the JSON Pointer path to that value and its precise location in the source text (line, column, and character position for both the key and value). This is useful when you need to report errors or warnings tied to specific parts of a JSON file and want to tell users exactly where to look. The library handles all JSON types—primitives (strings, numbers, booleans, null) and structures (arrays, objects)—and tracks whitespace correctly. It returns a dictionary mapping JSON Pointer paths to Entry objects, each containing start and end locations with line, column, and character position. No external runtime dependencies are required. Use it for: - Report validation errors in JSON files with exact line and column numbers for user-friendly error messages. - Build JSON linters or formatters that need to map diagnostics back to source positions. - Implement JSON-aware code editors or IDEs that highlight specific values or keys. - Debug JSON parsing issues by correlating parsed values with their exact source locations. - Generate source maps for JSON-to-code transpilers or code generators. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Maps each value in a JSON document to its source location (line, column, character position) and JSON Pointer path, enabling precise error reporting and source-aware JSON processing. Yes, if you need precise source location tracking for JSON values. The package is stable, has zero dependencies, and works on current Python versions. The dormant maintenance status is a minor concern only if you expect future Python compatibility issues; for current use (Python 3.8–3.11), it is reliable and ready to use. ## Install pip install json-source-map uv add json-source-map poetry add json-source-map ## Installing json-source-map Before you install: Low install friction with no runtime dependencies. Maintenance is dormant—last release was 2022-12-20 and last commit 2024-01-01—but the package is marked Production/Stable and supports current Python versions (3.8–3.11). License in practice: Licensed under Apache Software License (permissive), allowing free use, modification, and distribution with minimal restrictions. Quickstart: from json_source_map import calculate result = calculate('{"foo": "bar"}') print(result) # Maps JSON paths to Entry objects with value_start, value_end, key_start, key_end locations Verify before relying: - Whether dormant maintenance status poses a risk for future Python version compatibility or bug fixes. - Performance characteristics on large JSON documents (memory usage, parsing speed). ## Package facts - License: not declared (permissive) - Python support: supports_current - Install friction: low - Maintenance: dormant - Downloads: 374.0K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags json source location mapping, json pointer with line column, json error position tracking, json document source map, json value location finder, json parse position tracking, json-parsing, source-mapping, error-reporting [View on SkillFed](https://skillfed.io/packages/json-source-map) · [View on PyPI](https://pypi.org/project/json-source-map/)