Skip to main content

PyPI

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 for Python 3.

Example

{
    // 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:

from JsonhPy.JsonhPy import *

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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jsonhpy-2.9.tar.gz (14.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jsonhpy-2.9-py3-none-any.whl (13.9 kB view details)

Uploaded Python 3

File details

Details for the file jsonhpy-2.9.tar.gz.

File metadata

  • Download URL: jsonhpy-2.9.tar.gz
  • Upload date:
  • Size: 14.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for jsonhpy-2.9.tar.gz
Algorithm Hash digest
SHA256 20fd7bc28985485aff6dd08d1c71099cc664c899d2b2890de7306af8f2cc0735
MD5 a9dc18813003186742194e7dbc399d47
BLAKE2b-256 6cd4b369ec8b9617ecd8c065a9682914ad6de7f0f989099daffe6d8a393ae389

See more details on using hashes here.

File details

Details for the file jsonhpy-2.9-py3-none-any.whl.

File metadata

  • Download URL: jsonhpy-2.9-py3-none-any.whl
  • Upload date:
  • Size: 13.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for jsonhpy-2.9-py3-none-any.whl
Algorithm Hash digest
SHA256 f25d78a7f2ddade9b64bfb72365b7316c8b9243d19fa67671bc135239ea12216
MD5 5c8891cfee75e8d11cc2f3b6f4e3f77e
BLAKE2b-256 47e229192ce2665a578d4ffecb557d363bde964d854427351935adb0603814c3

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

2.9 This release

2 files

2.8

2 files

2.7

2 files

2.6

2 files

2.5

2 files

2.4

2 files

2.3

2 files

2.2

2 files

2.0

2 files

1.5

2 files

1.4

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page