Metadata-Version: 2.4
Name: tppt
Version: 0.3.0
Summary: Typed Python PowerPoint Tool
Project-URL: Documentation, https://yassun7010.github.io/tppt/
Project-URL: Homepage, https://github.com/yassun7010/tppt
Author-email: yassun7010 <yassun7010@outlook.com>
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
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: Programming Language :: Python :: 3.14
Classifier: Topic :: Office/Business :: Office Suites
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.11.0
Requires-Dist: pillow>=10.0.1
Requires-Dist: python-pptx>=1.0.2
Requires-Dist: typing-extensions>=4.13.2
Provides-Extra: pandas
Requires-Dist: pandas>=2.0.0; extra == 'pandas'
Provides-Extra: polars
Requires-Dist: polars>=0.20.0; extra == 'polars'
Provides-Extra: pydantic
Requires-Dist: pydantic>=2.0.0; extra == 'pydantic'
Provides-Extra: tool
Requires-Dist: rich-argparse>=1.7.0; extra == 'tool'
Requires-Dist: rich>=14.0.0; extra == 'tool'
Description-Content-Type: text/markdown

# 🎨 tppt

[![PyPI version](https://img.shields.io/pypi/v/tppt.svg)](https://pypi.org/project/tppt/)

✨ **tppt** is a type-safe PowerPoint presentation builder that lets you create stunning presentations with Python code! 🐍

This library is a wrapper around the [python-pptx](https://github.com/scanny/python-pptx) library,
providing a more intuitive and type-safe interface for creating PowerPoint presentations.
It allows you to build presentations using a builder pattern,
making it easy to create slides with various layouts, text formatting, images, and tables.

## 🚀 Installation

```bash
pip install tppt
```

## 📚 Documentation

For detailed documentation, please visit [Documentation](https://yassun7010.github.io/tppt/).

## 🎯 Usage Examples

### 📝 Basic Presentation Creation

```python
import tppt

# Create a presentation using the builder pattern
presentation = (
    tppt.Presentation.builder()
    # Slide 1: Title and Text
    .slide(
        lambda slide: slide.TitleLayout(
            title="Amazing Presentation",
            subtitle="Example of using tppt library",
        )
    )
    # Slide 2: Text with Formatting
    .slide(
        lambda slide: slide.BlankLayout()
        .builder()
        .text(
            "Amazing Presentation",
            left=(50, "pt"),
            top=(50, "pt"),
            width=(400, "pt"),
            height=(50, "pt"),
            size=(60, "pt"),
            bold=True,
            italic=True,
            color="#0000FF",
        )
        .text(
            "Example of using tppt library",
            left=(50, "pt"),
            top=(120, "pt"),
            width=(400, "pt"),
            height=(30, "pt"),
        )
    )
    # Slide 3: Image
    .slide(
        lambda slide: slide.BlankLayout()
        .builder()
        .text(
            "Python Logo Example",
            left=(50, "pt"),
            top=(50, "pt"),
            width=(300, "pt"),
            height=(40, "pt"),
        )
        .picture(
            "python-logo.png",
            left=(50, "pt"),
            top=(100, "pt"),
            width=(300, "pt"),
            height=(80, "pt"),
        )
    )
    # Slide 4: Table
    .slide(
        lambda slide: slide.BlankLayout()
        .builder()
        .text(
            "Table Example",
            left=(50, "pt"),
            top=(50, "pt"),
            width=(300, "pt"),
            height=(40, "pt"),
        )
        .table(
            [
                ["Product", "Price", "Stock"],
                ["Product A", "$10.00", "10 units"],
                ["Product B", "$25.00", "5 units"],
            ],
            left=(50, "pt"),
            top=(100, "pt"),
            width=(400, "pt"),
            height=(200, "pt"),
        )
    )
    .build()
)

# Save the presentation
presentation.save("output.pptx")
```

## ✨ Features

- 🛡️ Type-safe interface with comprehensive type hints
- 🏗️ Intuitive API using the builder pattern
- 🎨 Flexible slide layouts (Title, Title and Content, Blank)
- 📝 Rich text formatting capabilities:
  - 🅰️ Font size, bold, italic
  - 🎨 Custom colors
  - 🎯 Advanced text formatting through custom functions
- 🖼️ Image support with precise positioning
- 📊 Table creation with customizable dimensions
- 📏 Fine-grained control over element positioning and sizing
- 🎭 Support for custom slide masters

## 📜 License

MIT
