Metadata-Version: 2.4
Name: minimindslab-line-endings
Version: 0.1.0
Summary: Normalize and detect text line endings across LF, CRLF, and CR with optional trailing-newline control.
Author: MiniMindsLab
License: MIT
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# MiniMindsLab Line Endings

Tiny, offline, pure-Python helpers to detect and normalize text line endings.

## Features

- Detect dominant/consistent line ending style in a string:
  - `CRLF` (`\r\n`)
  - `LF` (`\n`)
  - `CR` (`\r`)
  - `NONE` (no line breaks)
  - `MIXED` (more than one style)
- Normalize any mixture of line endings to one target style.
- Optional control of whether output ends with a trailing newline.

## Install

This package is standard-library only and has no runtime dependencies.

## Usage

```python
from minimindslab_line_endings import detect_line_ending, normalize_text

text = "a\r\nb\r\nc"
print(detect_line_ending(text))  # CRLF

normalized = normalize_text(text)
print(repr(normalized))  # 'a\nb\nc'

normalized_crlf = normalize_text(text, line_ending="CRLF", ensure_trailing_newline=True)
print(repr(normalized_crlf))  # 'a\r\nb\r\nc\r\n'
```

## API

- `detect_line_ending(text: str) -> str`
- `normalize_text(text: str, line_ending: str = "LF", ensure_trailing_newline: bool | None = None) -> str`

## License

MIT
