Skip to main content

JSON superset with relaxed syntax and runtime patching

Project description

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

Project details


Download files

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

Source Distribution

pyjsony-0.1.17.tar.gz (14.2 MB view details)

Uploaded Source

Built Distribution

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

pyjsony-0.1.17-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file pyjsony-0.1.17.tar.gz.

File metadata

  • Download URL: pyjsony-0.1.17.tar.gz
  • Upload date:
  • Size: 14.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for pyjsony-0.1.17.tar.gz
Algorithm Hash digest
SHA256 71291bd7d06d85b71c7db773084520924da18aa7d0bd2c4818e345f25acfd587
MD5 4bca9a46e7d1fd14c3a4214563256fd3
BLAKE2b-256 9aa352b35f35e65209b1eb573a49ab2ccc788a5d2a8364251989a82e90f90d12

See more details on using hashes here.

File details

Details for the file pyjsony-0.1.17-py3-none-any.whl.

File metadata

  • Download URL: pyjsony-0.1.17-py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for pyjsony-0.1.17-py3-none-any.whl
Algorithm Hash digest
SHA256 42a8bca8d79c7170fd904e474db270cea27cc4836ff59dfff32687f66447cae7
MD5 1219c2d7c6d013c65374c6210e8a0e41
BLAKE2b-256 fb78cd253eb174074ac52a06fe81fc9040b0569addf3f30a1beb933813328957

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page