Metadata-Version: 2.4
Name: minimindslab-key-value-parse
Version: 0.1.0
Summary: Parse simple key=value text into a deterministic mapping with configurable comment and blank-line handling.
Author: MiniMindsLab
License: MIT
Keywords: parser,key-value,config
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# MiniMindsLab Key Value Parse

A tiny, deterministic parser for simple `key=value` text.

## Features

- Parses lines in `key=value` form.
- Duplicate keys are resolved by keeping the **last** value.
- Ignores blank lines and comment lines with configurable prefix.
- Optional trimming of surrounding whitespace for keys/values.
- Pure Python, standard library only.

## Installation

```bash
pip install minimindslab-key-value-parse
```

## Usage

```python
from minimindslab_key_value_parse import parse_key_value_text

text = """
# sample
host = localhost
port=8080
host=example.com
"""

result = parse_key_value_text(text)
# {'host': 'example.com', 'port': '8080'}
```

## API

### `parse_key_value_text(text, *, comment_prefix="#", trim_whitespace=True, ignore_blank_lines=True, ignore_comment_lines=True)`

Returns a deterministic `dict[str, str]` parsed from input text.

- Raises `TypeError` if `text` is not a string.
- Raises `ValueError` for non-empty, non-comment lines without `=`.
- Raises `ValueError` if a parsed key is empty.

## License

MIT
