Metadata-Version: 2.4
Name: minimindslab-json-number-normalize
Version: 0.1.0
Summary: Normalize number-like JSON values in parsed Python data structures to a consistent representation for stable comparisons and snapshots.
Author: MiniMindsLab
License: MIT
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# MiniMindsLab JSON Number Normalize

Normalize number-like values in parsed JSON-style Python data for stable comparisons and snapshots.

## What it does

- Recursively processes nested `dict`, `list`, and `tuple` structures.
- Normalizes numeric Python values (`int`, `float`) deterministically.
- Leaves strings unchanged by default (including numeric strings like `"01"`).
- Returns a new structure and does not mutate the input.

## API

```python
from minimindslab_json_number_normalize import normalize_numbers

result = normalize_numbers(data, whole_floats_to_int=True)
```

### Parameters

- `data`: JSON-like parsed Python structure.
- `whole_floats_to_int` (default `True`): converts floats like `1.0` to `1`.
- `normalize_numeric_strings` (default `False`): if enabled, attempts to parse numeric-looking strings into numbers.

## Example

```python
from minimindslab_json_number_normalize import normalize_numbers

payload = {
    "a": 1.0,
    "b": [2.0, "01", {"c": 3.5}],
}

print(normalize_numbers(payload))
# {'a': 1, 'b': [2, '01', {'c': 3.5}]}
```

## Testing

```bash
python -m unittest discover -s tests -p "test*.py"
```
