Metadata-Version: 2.4
Name: json5-document
Version: 2026.10.15.1
Summary: Typed JSON5 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/json5-document/
Project-URL: Source, https://github.com/adamtheturtle/json5-document
Keywords: comments,json5,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

json5-document
==============

A typed JSON5 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 json5-document

Usage
-----

.. code-block:: python

    """Parse JSON5 while preserving source comments."""

    import json5_document

    source = "// heading\n{count: 2,}"
    document = json5_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/json5-document/>`_ for the full API and parsing policies.
