Typed Python PowerPoint Tool
Project description
🎨 tppt
✨ tppt is a type-safe PowerPoint presentation builder that lets you create stunning presentations with Python code! 🐍
🚀 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
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
tppt-0.1.0.tar.gz
(391.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
tppt-0.1.0-py3-none-any.whl
(40.5 kB
view details)
File details
Details for the file tppt-0.1.0.tar.gz.
File metadata
- Download URL: tppt-0.1.0.tar.gz
- Upload date:
- Size: 391.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4a7c128c09927ab3cad1c2178bacbf2a4d89be27ed228fec86c98d85088a83ab
|
|
| MD5 |
17877c209df54f398f5c6ac5909d6625
|
|
| BLAKE2b-256 |
cca500fe295e24367f4d9df5743b8d3c709c9734a8f44406043efcc00de184cb
|
File details
Details for the file tppt-0.1.0-py3-none-any.whl.
File metadata
- Download URL: tppt-0.1.0-py3-none-any.whl
- Upload date:
- Size: 40.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
13bef881c2c9c5ba276bd27f4ceb4d11be4c9f244101e014af0826b0c171ccd1
|
|
| MD5 |
c3f7cceafdf867eef5e7824744c10068
|
|
| BLAKE2b-256 |
f341e3dfec724d294dac5045bff9e902acdd80cde858be6516d55c8fa01056e5
|