Metadata-Version: 2.4
Name: minimindslab-toml-sort
Version: 0.1.0
Summary: Deterministically sort TOML keys in a stable, human-friendly order while preserving values and comments as much as possible within a tiny pure-Python scope.
Author: MiniMindsLab
License: MIT
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# MiniMindsLab TOML Sort

Deterministically sort TOML keys in a stable, human-friendly order for small TOML files.

## What it does

- Parses TOML text using Python's standard library (`tomllib`).
- Recursively sorts keys alphabetically for all tables.
- Produces stable output for the same logical TOML content.
- Preserves scalar values, arrays, booleans, numbers, and strings when parsed back.

## Scope note

This package is intentionally tiny and pure-Python. It focuses on canonical key ordering and value preservation, not full formatting/comment round-trip fidelity.

## Usage

```python
from minimindslab_toml_sort import sort_toml_text

input_text = '''
[b]
z = 2
a = 1

[a]
k = "v"
'''

sorted_text = sort_toml_text(input_text)
print(sorted_text)
```

## API

- `sort_toml_text(text: str) -> str`
  - Returns sorted TOML text.
  - Raises `ValueError` on invalid TOML input.
