A library to programmatically create presentation slide decks
Project description
Rendu
A programmatic presentation generator library for Python
Introduction
Rendu allows programmatic construction of professional-looking HTML slide decks similar in concept to documents that can be created with presentation software like Microsoft Powerpoint, Apple's Keynote or LibreOffice Impress.
Rendu reports are composed of multiple slides and feature easy navigation via push buttons whose behavior is regulated by javascript code that is automatically generated by the library.
Rendu is particularly useful to create and assemble a slide deck as a final pipeline step in any type of data analysis.
Main Features
- Create slide decks programmatically from within Python code
- Single HTML file, can be rendered by any web browser that supports Javascript
- Easy slide navigation through push-button HTML widgets
- Text: supports paragraphs, unordered and ordered lists
- Images: Embed and display png and jpg
- Raw Data: embed files within the document, download via push button widget
- Optimized slide layout divided in main and side area
Screenshots
Quick Start-Up Reference
The following example uses Pandas and Seaborn to download a dataset, compute some statistics on it and plot a histogram and save data into a CSV file. The dataset analysis is just an example that is used to showcase how to create a Rendu slide deck and add text, plots and even embed the raw CSV file into the final document. The resulting HTML rendering is shown in the screenshots of the previous section.
import os
import seaborn as sns
import matplotlib as mpl
from datetime import date
from rendu.htmldeck import HtmlSlideDeck
# ----------------------------------------------- #
# Use pandas/seaborn to perform some data analysis
# ----------------------------------------------- #
os.makedirs('./tmp', exist_ok=True)
mpl.use('AGG')
penguins = sns.load_dataset('penguins')
fig = sns.displot(penguins, x='flipper_length_mm')
fig.savefig('./tmp/penguins_histogram.png')
flen_ave = penguins.flipper_length_mm.mean().round(2)
flen_med = penguins.flipper_length_mm.median().round(2)
flen_std = penguins.flipper_length_mm.std().round(2)
penguins.to_csv('./tmp/penguins.csv')
# ------------------------------------------------------ #
# Now use rendu to quickly assemble an HTML presentation
# ------------------------------------------------------ #
# Create HTML report
rep = HtmlSlideDeck(f'Analysis Of Penguin Population [{date.today()}]',
footer='University Of Penguinia, dept. of Marine Science')
# Add intro slide
s = rep.add_slide(0, "Penguin Study Report", "Intro")
s.main.add_h2('Data Sources')
s.main.add_ul(['Raw data available at seaborn-data repository',
'https://github.com/mwaskom/seaborn-data'])
s.main.add_h2('Disclaimer')
s.main.add_p('NO PENGUINS WERE HARMED FOR THIS STUDY')
s.side.add_h2('Authors')
s.side.add_ul(['John Doe, PhD', 'Jane Doe, PhD'])
# Add slide with histogram with stats
s = rep.add_slide(1, "Flipper Length Distribution", "Flipper Length")
# Add figure to main layout
s.main.add_figure('./penguins_histogram.png')
# Add more info to side layout
s.side.add_h2('Main Stats')
s.side.add_ul([f'Average: {flen_ave}',
f'Median: {flen_med}',
f'Std: {flen_std}'])
# Add slide that embeds raw data
s = rep.add_raw_data_slide(2, "Raw Data", "Raw Data", './tmp/penguins.csv')
# Save report
rep.save('./tmp/penguin_report.html')
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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
File details
Details for the file rendu-0.1.1.tar.gz.
File metadata
- Download URL: rendu-0.1.1.tar.gz
- Upload date:
- Size: 10.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f4e4aa24aeb8a4dcf50d2743198980d71a88f05598480820d59f8cd836bb2f57
|
|
| MD5 |
5ff4b0805ab8cd22491706b9faeb165f
|
|
| BLAKE2b-256 |
62edb432f1f506157acce1106a6891e53403714c51e4a8e3b84626f1f0dd2743
|
File details
Details for the file rendu-0.1.1-py3-none-any.whl.
File metadata
- Download URL: rendu-0.1.1-py3-none-any.whl
- Upload date:
- Size: 9.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
60b3a3f906d6d949763f6f54e8f15f61547e8fd02c42995b553b9e0001b9eecc
|
|
| MD5 |
6f3d19b6a80d1111766db196dc12ee6f
|
|
| BLAKE2b-256 |
cd1bfcdb2d2a4388d5d6f7a19f365c1e2032f407b253679e77f38d46fc0009ae
|