Metadata-Version: 2.4
Name: rtflite
Version: 2.5.4
Summary: Lightweight RTF composer for Python
Project-URL: Homepage, https://pharmaverse.github.io/rtflite/
Project-URL: Documentation, https://pharmaverse.github.io/rtflite/
Project-URL: Repository, https://github.com/pharmaverse/rtflite
Project-URL: Issues, https://github.com/pharmaverse/rtflite/issues
Project-URL: Changelog, https://github.com/pharmaverse/rtflite/blob/main/CHANGELOG.md
Author-email: Yilong Zhang <elong0527@gmail.com>, Nan Xiao <me@nanx.me>
License-File: LICENSE
License-File: LICENSES_THIRD_PARTY
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Healthcare Industry
Classifier: Intended Audience :: Information Technology
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Office/Business :: Office Suites
Classifier: Topic :: Text Processing
Requires-Python: >=3.10
Requires-Dist: narwhals>=1.0.0
Requires-Dist: pillow>=8.0.0
Requires-Dist: polars>=1.0.0
Requires-Dist: pydantic>=2.0.0
Provides-Extra: docx
Requires-Dist: python-docx>=1.0.0; extra == 'docx'
Provides-Extra: pdf
Requires-Dist: pypdf>=5.0.0; extra == 'pdf'
Description-Content-Type: text/markdown

# rtflite <img src="https://github.com/pharmaverse/rtflite/raw/main/docs/assets/logo.png" align="right" width="120" />

[![PyPI version](https://img.shields.io/pypi/v/rtflite)](https://pypi.org/project/rtflite/)
![Python versions](https://img.shields.io/pypi/pyversions/rtflite)
[![pharmaverse rtflite badge](http://pharmaverse.org/shields/rtflite.svg)](https://pharmaverse.org)
[![CI tests](https://github.com/pharmaverse/rtflite/actions/workflows/ci-tests.yml/badge.svg)](https://github.com/pharmaverse/rtflite/actions/workflows/ci-tests.yml)
[![Mypy check](https://github.com/pharmaverse/rtflite/actions/workflows/mypy.yml/badge.svg)](https://github.com/pharmaverse/rtflite/actions/workflows/mypy.yml)
[![Ruff check](https://github.com/pharmaverse/rtflite/actions/workflows/ruff-check.yml/badge.svg)](https://github.com/pharmaverse/rtflite/actions/workflows/ruff-check.yml)
[![Documentation](https://github.com/pharmaverse/rtflite/actions/workflows/docs.yml/badge.svg)](https://pharmaverse.github.io/rtflite/)
![License](https://img.shields.io/pypi/l/rtflite)
[![View Code Wiki](https://www.gstatic.com/_/boq-sdlc-agents-ui/_/r/ytWqxKl5yfM.svg)](https://codewiki.google/github.com/pharmaverse/rtflite)

Lightweight RTF composer for Python.

Specializes in precise formatting of production-quality tables and figures. Inspired by [r2rtf](https://merck.github.io/r2rtf/).

## Installation

You can install rtflite from PyPI:

```bash
pip install rtflite
```

Or install the development version from GitHub:

```bash
git clone https://github.com/pharmaverse/rtflite.git
cd rtflite
python3 -m pip install -e .
```

### Optional dependencies - DOCX support

Some features in rtflite require additional dependencies.
To install rtflite with DOCX assembly support:

```bash
pip install rtflite[docx]
```

To add rtflite as a dependency with DOCX support for projects using uv:

```bash
uv add rtflite --extra docx
```

For rtflite developers, sync all optional dependencies with:

```bash
uv sync --all-extras
```

### Optional dependencies - LibreOffice

rtflite can convert RTF documents to PDF and DOCX using LibreOffice.
To enable this feature, install LibreOffice (free and open source, MPL license).

See the [converter setup
guide](https://pharmaverse.github.io/rtflite/articles/converter-setup/)
for detailed instructions.

## Contributing

We welcome contributions to rtflite. Please read the rtflite
[Contributing Guidelines](https://pharmaverse.github.io/rtflite/contributing/)
to get started.

All interactions within rtflite repositories and issue trackers should adhere to
the rtflite [Contributor Code of Conduct](https://github.com/pharmaverse/rtflite/blob/main/CODE_OF_CONDUCT.md).

## License

This project is licensed under the terms of the MIT license.
