CSONH - Concise Structured Object Notation for Humanity
Project description
CSONH - Concise Structured Object Notation for Humanity
A strict, data-only configuration format that's easy to read and write. Zero dependencies.
CSONH = JSON's clarity + YAML's readability + strict safety guarantees.
Quick Start
Python
import csonh
# From string
config = csonh.loads('''
server:
host: 'localhost'
port: 8080
debug: yes
''')
# From file
with open('config.csonh', 'r') as f:
config = csonh.load(f)
CoffeeScript / Node.js
CSONH = require('./csonh')
# From string
config = CSONH.parse '''
server:
host: 'localhost'
port: 8080
debug: yes
'''
# From file (Node.js)
fs = require('fs')
source = fs.readFileSync('config.csonh', 'utf8')
config = CSONH.parse(source)
Installation
Direct Use (No Package Manager)
Python: Copy csonh.py to your project
CoffeeScript: Copy csonh.coffee to your project
Via Package Manager (Coming Soon)
Python: pip install csonh
Node.js: npm install csonh
Features
- Human-friendly: Indentation-based like Python/YAML
- Type-safe: Integers, floats, hex/binary/octal, booleans, null
- Comments: Line (
#) and block (###...###) - Multiline strings: Triple-quoted with auto-dedenting
- Strict: No code execution, no arithmetic, no surprises
- Zero dependencies: Single file, standard library only
Example
# Application configuration
app:
name: 'MyApp'
version: '1.2.3'
# Database settings
database:
host: 'localhost'
port: 5432
pool:
min: 2
max: 10
# Feature flags
features: [
'authentication',
'caching',
'logging'
]
# Environment-specific
production:
debug: no
workers: 8
development:
debug: yes
workers: 1
Result:
{
'app': {'name': 'MyApp', 'version': '1.2.3'},
'database': {'host': 'localhost', 'port': 5432, 'pool': {'min': 2, 'max': 10}},
'features': ['authentication', 'caching', 'logging'],
'production': {'debug': False, 'workers': 8},
'development': {'debug': True, 'workers': 1}
}
What Makes CSONH Different
Safe by design:
- ❌ No string interpolation (
#{}) - ❌ No arithmetic expressions
- ❌ No code execution
- ❌ No bareword values
- ✅ Just data
Precise behavior:
- Unambiguous parsing (unlike YAML)
- Complete specification
- Consistent across implementations
Language Support
- ✅ Python 3.7+ -
csonh.py - ✅ CoffeeScript/Node.js -
csonh.coffee
Both implementations pass the same 120-test validation suite.
Documentation
Full specification: CSONH_STANDARD.md
License
MIT License - See LICENSE file
Contributing
CSONH 1.0 specification is final and stable. The format will not change.
Bug reports and implementation improvements are welcome via GitHub issues.
Credits
Developed in team collaboration with (in no particular order):
Claude (Anthropic), ChatGPT (OpenAI), and Gemini (Google)
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 csonh-1.0.1.tar.gz.
File metadata
- Download URL: csonh-1.0.1.tar.gz
- Upload date:
- Size: 9.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
896ecd55c283640fbd14dcdaaa98e3d0b826881916dfb7ae613ae5a68dff5196
|
|
| MD5 |
c7fa26134ab82ffa466b085aeee57b02
|
|
| BLAKE2b-256 |
615ef2e16d1d89c6cff36254532005a4e316d720e26439fca92353a0e790a758
|
File details
Details for the file csonh-1.0.1-py3-none-any.whl.
File metadata
- Download URL: csonh-1.0.1-py3-none-any.whl
- Upload date:
- Size: 9.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
80bc34af0384e9f7b3cc52e615f5f8350bce610fc2add0606a54e7f2541eed2d
|
|
| MD5 |
c866fd27b0387570f5aee8fda1c49b49
|
|
| BLAKE2b-256 |
e5d50b4b26e5790d3b784e36fba02e0e6f08a6527f72a83fae32b096e6a18708
|