Metadata-Version: 2.4
Name: jsonc-document
Version: 2026.10.15
Summary: Typed JSONC parsing with preserved comments, tokens, and source spans.
Author-email: Adam Dangoor <adamdangoor@gmail.com>
License-Expression: MIT
Project-URL: Documentation, https://adamtheturtle.github.io/jsonc-document/
Project-URL: Source, https://github.com/adamtheturtle/jsonc-document
Keywords: comments,jsonc,parser
Classifier: Development Status :: 4 - Beta
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: 3.15
Requires-Python: >=3.12
Description-Content-Type: text/x-rst
License-File: LICENSE
Dynamic: license-file

jsonc-document
==============

A typed JSONC parser that preserves comments, tokens, and source spans.
It requires Python 3.12 or newer and has no runtime dependencies.

Installation
------------

.. code-block:: console

    pip install jsonc-document

Usage
-----

.. code-block:: python

    """Parse JSONC while preserving source comments."""

    import jsonc_document

    source = '// heading\n{"count": 2}'
    document = jsonc_document.parse(source=source)
    assert document.value == {"count": 2}
    assert document.comments[0].text == "// heading"
    assert document.to_source() == source

Use ``loads(source=...)`` when only Python values are needed.
See the `documentation <https://adamtheturtle.github.io/jsonc-document/>`_ for the full API and parsing policies.
