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
jsonviajsonx.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 Pythonjsonmodule.
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
71291bd7d06d85b71c7db773084520924da18aa7d0bd2c4818e345f25acfd587
|
|
| MD5 |
4bca9a46e7d1fd14c3a4214563256fd3
|
|
| BLAKE2b-256 |
9aa352b35f35e65209b1eb573a49ab2ccc788a5d2a8364251989a82e90f90d12
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
42a8bca8d79c7170fd904e474db270cea27cc4836ff59dfff32687f66447cae7
|
|
| MD5 |
1219c2d7c6d013c65374c6210e8a0e41
|
|
| BLAKE2b-256 |
fb78cd253eb174074ac52a06fe81fc9040b0569addf3f30a1beb933813328957
|