Metadata-Version: 2.4
Name: JsonhPy
Version: 2.5
Summary: JSON for Humans in Python.
Author-email: Joyless <joyless.mod@gmail.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/jsonh-org/JsonhPy
Project-URL: Issues, https://github.com/jsonh-org/JsonhPy/issues
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE.md
Dynamic: license-file

<img src="https://github.com/jsonh-org/Jsonh/blob/main/IconUpscaled.png?raw=true" width=180>

[![PyPI](https://img.shields.io/pypi/v/JsonhPy.svg)](https://pypi.python.org/pypi/JsonhPy)

**JSON for Humans.**

JSON is great. Until you miss that trailing comma... or want to use comments. What about multiline strings?
JSONH provides a much more elegant way to write JSON that's designed for humans rather than machines.

Since JSONH is compatible with JSON, any JSONH syntax can be represented with equivalent JSON.

## JsonhPy

JsonhPy is a parser implementation of [JSONH V1 & V2](https://github.com/jsonh-org/Jsonh) for Python 3.

## Example

```jsonh
{
    // use #, // or /**/ comments
    
    // quotes are optional
    keys: without quotes,

    // commas are optional
    isn\'t: {
        that: cool? # yes
    }

    // use multiline strings
    haiku: '''
        Let me die in spring
          beneath the cherry blossoms
            while the moon is full.
        '''
    
    // compatible with JSON5
    key: 0xDEADCAFE

    // or use JSON
    "old school": 1337
}
```

## Usage

Everything you need is contained within `JsonhReader`:

```py
from JsonhPy.JsonhPy import *

jsonh: str = """
{
    this is: awesome
}
"""
json: object = JsonhReader.parse_element_from_string(jsonh).value()
```
