Metadata-Version: 2.4
Name: csonh
Version: 1.0.1
Summary: CSONH - Concise Structured Object Notation for Humanity
Author-email: Michael Goldman <mike.goldman@allstreets.org>
License: MIT License
        
        Copyright (c) 2025 Michael Goldman
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/pythagorean/csonh
Project-URL: Issues, https://github.com/pythagorean/csonh/issues
Keywords: cson,json,parser,config,strict
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Text Processing :: Markup
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# 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

```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

```coffeescript
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

```csonh
# 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:
```python
{
  '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`](CSONH_STANDARD.md)

## License

MIT License - See [LICENSE](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)
