Metadata-Version: 2.4
Name: minimindslab-textwrap-preserve
Version: 0.1.0
Summary: Wrap plain text while preserving existing paragraph breaks, bullet indentation, and blank lines.
Author: MiniMindsLab
License: MIT
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# MiniMindsLab Textwrap Preserve

Wrap plain text while preserving existing paragraph breaks, bullet indentation, and blank lines.

## Features

- Preserves blank-line-separated paragraph boundaries.
- Preserves bullet/list prefixes (including indentation) and aligns continuation lines.
- Normalizes line endings to `\n`.
- Deterministic output for identical inputs.
- Pure Python (standard library only).

## Installation

```bash
pip install minimindslab-textwrap-preserve
```

## Usage

```python
from minimindslab_textwrap_preserve import wrap_preserve

text = """
Intro paragraph that is very long and should wrap nicely while keeping structure.

  - First bullet item that is also long enough to wrap across multiple lines.
  - Second bullet.
""".strip("\n")

result = wrap_preserve(text, width=40)
print(result)
```

## API

### `wrap_preserve(text: str, width: int = 80) -> str`

Reflows each non-blank line to fit `width`, while:

- keeping blank lines intact,
- preserving paragraph/list boundaries line-by-line,
- preserving indentation and bullet prefixes for list-like lines.

Raises:

- `TypeError` if `text` is not a string.
- `ValueError` if `width < 1`.

## License

MIT
