🎨 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 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
pip install tppt
📚 Documentation
For detailed documentation, please visit Documentation.
🎯 Usage Examples
📝 Basic Presentation Creation
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
Metadata
Release files for tppt 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| tppt-0.4.0.tar.gz | 406.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| tppt-0.4.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 457.7 kB
Release files / tppt-0.4.0.tar.gz
| Download URL | tppt-0.4.0.tar.gz |
|---|---|
| Size | 406.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6c51d34419682897716ae46658a37ad21a0c00585582ce574d0ce551d3bc6b52
|
|
BLAKE2b-256 checksum How to use checksums |
beed294d35f7a679304ab761a958c4f98220352d5f11566000be0f6f0e333d91
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / tppt-0.4.0-py3-none-any.whl
| Download URL | tppt-0.4.0-py3-none-any.whl |
|---|---|
| Size | 50.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
554645d57d8a44c4aecdbc46aa3e838cc99c0c581d2a393c3edfbd31928323ef
|
|
BLAKE2b-256 checksum How to use checksums |
1679b1fb108e0f271a95a4ad6588a5eff913bdd3f32692d83d330dd86e73c35a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|