Metadata-Version: 2.4
Name: prose-tools
Version: 1.0.0
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Text Processing
Requires-Dist: maturin>=1.7,<2.0 ; extra == 'dev'
Requires-Dist: pytest>=8.0 ; extra == 'dev'
Requires-Dist: ruff>=0.8 ; extra == 'dev'
Requires-Dist: datasets>=3.0 ; extra == 'train'
Requires-Dist: numpy>=1.26 ; extra == 'train'
Requires-Dist: safetensors>=0.4 ; extra == 'train'
Requires-Dist: torch>=2.2 ; extra == 'train'
Requires-Dist: transformers>=4.46 ; extra == 'train'
Provides-Extra: dev
Provides-Extra: train
License-File: LICENSE
Summary: Format prose, predict line breaks, and train formatting models.
Keywords: prose,formatter,markdown,latex,line-breaking
License-Expression: MIT
Requires-Python: >=3.11
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Homepage, https://github.com/khwstolle/prose-tools
Project-URL: Issues, https://github.com/khwstolle/prose-tools/issues
Project-URL: Repository, https://github.com/khwstolle/prose-tools

# prose-tools

`prose` wraps lines in LaTeX,
Markdown,
and plain text,
preserving markup,
indentation,
equations,
and code blocks.

## Installation

```bash
# CLI binary
cargo install prose-tools

# Python package (`prose` module and CLI)
pip install prose-tools

# Optional training extras
pip install "prose-tools[train]"

# Nix
nix run github:khwstolle/prose-tools -- --help
```

## Usage

```bash
# Format a file to stdout or in place
prose format document.tex
prose format -w document.md

# Check formatting without modifying files
prose check document.tex

# Start the HTTP or MCP server
prose serve --port 8765
prose serve --mcp

# Module invocation
python -m prose --help
```

## Python API

```python
from prose import Formatter

formatter = Formatter("mini")
formatted = formatter.format_text(
    "The encoder processes each block. A linear readout predicts breaks.",
    file_type="latex",
)
```

## Guides and examples

- [Configuration](docs/configuration.md)
- [HTTP server and MCP](docs/server.md)
- [Training and export](docs/training.md)
- [Examples](examples/README.md)

Licensed under the MIT License.

