Metadata-Version: 2.4
Name: rpptx
Version: 0.11.0
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Rust
Classifier: Topic :: Office/Business
Classifier: Topic :: Software Development :: Libraries
Summary: Native PPTX creation, editing, comments, notes, and rendering for Python
Keywords: pptx,powerpoint,ooxml,presentations,pdf
Home-Page: https://github.com/tensorbee/rdocx
Author: Atul Sharma
License-Expression: MIT OR Apache-2.0
Requires-Python: >=3.9
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Changelog, https://github.com/tensorbee/rdocx/blob/main/CHANGELOG.md
Project-URL: Homepage, https://github.com/tensorbee/rdocx
Project-URL: Issues, https://github.com/tensorbee/rdocx/issues
Project-URL: Repository, https://github.com/tensorbee/rdocx

# rpptx-py

Native rpptx for Python

`rpptx` gives Python applications a native PPTX workflow for creating,
opening, editing, and saving PowerPoint-compatible presentations. It also
supports comments, speaker notes, and deterministic rendering. It works
directly with OOXML packages and does not require Microsoft PowerPoint,
LibreOffice, a conversion service, or a Java or .NET runtime.

The package uses the Rust `rpptx` presentation engine and ships with a default
presentation template for from-scratch deck creation.

## Installation

Install the current release from PyPI:

```sh
python -m pip install rpptx
```

`rpptx` requires CPython 3.9 or newer. Its platform wheels use the Python 3.9
stable ABI, so one wheel supports multiple compatible Python versions. Source
installation requires a Rust toolchain and maturin.

## Quick start

```python
from rpptx import Presentation
from rpptx.util import Inches

presentation = Presentation()
slide = presentation.slides.add_slide(presentation.slide_layouts[6])
text_box = slide.shapes.add_textbox(
    Inches(1), Inches(1), Inches(8), Inches(1)
)
text_box.text = "Quarterly review"
presentation.save("review.pptx")

pdf = presentation.to_pdf()
with open("review.pdf", "wb") as output:
    output.write(pdf)
```

## Capabilities

- File and byte-based PPTX input and output.
- Slide layouts, slides, placeholders, shapes, text frames, paragraphs, runs,
  pictures, preset shapes, and tables.
- Deterministic PDF and PNG output for slides and speaker notes.
- Speaker-note text plus modern comment authors, threads, replies, and ordered
  comment movement.
- Read speaker-note text and inspect or mutate modern comment threads.
- Python collections with negative indexes, slices, iteration, and explicit
  stale-handle errors after structural changes.

## Use it when

Use `rpptx` when a Python service, desktop application, or automation task
needs to create, inspect, update, comment on, or render presentations locally.
It is suited to generated decks, template workflows, review, and previews.

## Relationship

The Python API is intentionally focused. It covers the documented `rpptx`
surface and the reviewed python-pptx Getting Started workflows, but it is not a
drop-in replacement for every python-pptx method or private lxml object.

## Example

Open and inspect an existing presentation:

```python
from rpptx import Presentation

presentation = Presentation("deck.pptx")
print(len(presentation.slides))
png = presentation.render_slide_to_png(0)
for slide in presentation.slides:
    print(slide.notes_text or "")
```

## Type checking

The distribution includes hand-written extension stubs and a `py.typed`
marker. Editors and type checkers can inspect concrete presentation, slide,
shape, text, table, notes, and comment types.

```sh
python -m pip install mypy
python -m mypy your_application.py
```

The release gate validates the installed package with strict mypy and
`stubtest` in addition to its runtime suite.

## Project links

- [Source repository](https://github.com/tensorbee/rdocx)
- [Issue tracker](https://github.com/tensorbee/rdocx/issues)
- [Changelog](https://github.com/tensorbee/rdocx/blob/main/CHANGELOG.md)
- [Binding specification](https://github.com/tensorbee/rdocx/blob/main/docs/hld/10-bindings-spec.md)

## License

Licensed under either the
[MIT License](https://github.com/tensorbee/rdocx/blob/main/LICENSE) or the
[Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0), at your
option.

