Skip to main content

JSONY

JSONY is a JSON superset and runtime compatibility layer that extends JSON syntax while remaining fully usable as a drop-in replacement via standard library patching.

It is designed for gradual migration of large Python codebases and configuration-heavy systems.


Why JSONY

JSON is strict, verbose, and unfriendly to human editing.

JSONY introduces a relaxed syntax while preserving compatibility with Python’s json module via optional runtime patching.


Features

  • Optional quotes for keys and string values
  • Line (//) and block (/* */) comments
  • Trailing commas in objects and arrays
  • Bare identifiers (foo, bar, null, true, false)
  • UTF-8 strict parsing
  • Drop-in replacement for Python json via jsonx.patch()
  • Deterministic parsing behavior

Quick start

1. Patch standard JSON module

import pyjsony

pyjsony.patch()

import json

data = json.loads("""
a: 1,
b: 2,
c: {
    nested: value
}
""")

print(data)

2. Direct usage (no patching)

from pyjsony import loads

data = loads("""
obj: {
    foo: bar,
    list: [1, 2, 3]
}
""")

Syntax example

// JSONY allows relaxed, human-friendly syntax

config:
{
    host: localhost,
    port: 8080,

    features: [
        logging,
        metrics,
        tracing,
    ]
}

Comparison with JSON

Feature JSON JSONY
Unquoted keys ❌ ✅
Comments ❌ ✅
Trailing commas ❌ ✅
Bare identifiers ❌ ✅
Patch integration ❌ ✅

Installation

pip

pip install pyjsony

uv

uv add pyjsony

or

uv pip install pyjsony

Design goals

  • Backwards-compatible superset of JSON syntax
  • Seamless migration path for large Python codebases
  • Minimal cognitive overhead for configuration files
  • Runtime opt-in compatibility via patch()

Warning

⚠️ jsony.patch() mutates the global Python json module.

This affects all code in the current runtime process, including dependencies that rely on standard JSON behavior.

Use with care in shared or library-heavy environments.


License

BSD2-Clause


Statuses

pipeline status

Metadata

Release files for pyjsony 0.1.17

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyjsony 0.1.17
File Size Uploaded Provenance Actions
pyjsony-0.1.17.tar.gz 14.2 MB Without provenance Details for pyjsony-0.1.17.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pyjsony 0.1.17
File Interpreter ABI Platform Actions
pyjsony-0.1.17-py3-none-any.whl Python 3 none any Details for pyjsony-0.1.17-py3-none-any.whl

Total release size: 14.2 MB

Release files / pyjsony-0.1.17.tar.gz

Download URL pyjsony-0.1.17.tar.gz
Size 14.2 MB
Tags Source
SHA-256 checksum
How to use checksums
71291bd7d06d85b71c7db773084520924da18aa7d0bd2c4818e345f25acfd587
BLAKE2b-256 checksum
How to use checksums
9aa352b35f35e65209b1eb573a49ab2ccc788a5d2a8364251989a82e90f90d12
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.4

Release files / pyjsony-0.1.17-py3-none-any.whl

Download URL pyjsony-0.1.17-py3-none-any.whl
Size 7.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
42a8bca8d79c7170fd904e474db270cea27cc4836ff59dfff32687f66447cae7
BLAKE2b-256 checksum
How to use checksums
fb78cd253eb174074ac52a06fe81fc9040b0569addf3f30a1beb933813328957
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.4

Security for pyjsony 0.1.17

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.17 This release

2 release files No provenance

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