Skip to main content

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

First slide of example in next section Second slide of example in next section Third slide of example in next section

Installation

Rendu is available on PyPI and can be installed via pip:

pip install rendu

Quick Start-Up Example

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')

More Documentation

The full library API reference is available at this link

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

rendu-0.1.2.tar.gz (19.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rendu-0.1.2-py3-none-any.whl (17.2 kB view details)

Uploaded Python 3

File details

Details for the file rendu-0.1.2.tar.gz.

File metadata

  • Download URL: rendu-0.1.2.tar.gz
  • Upload date:
  • Size: 19.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for rendu-0.1.2.tar.gz
Algorithm Hash digest
SHA256 73581edd65cb94ee51f7d727281b3e3ff6ea0f3958c66883ee8828ddff6c6580
MD5 46867876c222b6fef49a839a8dfe4eb6
BLAKE2b-256 18463429906077e658426f417123d51ee701c4f411286faa75ec712ac8c4a366

See more details on using hashes here.

Provenance

The following attestation bundles were made for rendu-0.1.2.tar.gz:

Publisher: release.yml on mborsalino/rendu

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rendu-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: rendu-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 17.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for rendu-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 77e1d6261914c816210741c0770a988759083e734d3f11326d07c4af0c00e1f3
MD5 1970341a8783b230889c88a4422c63cb
BLAKE2b-256 42d2de9fe2ddde1222e2a89c168f146d1f753d2cfe4f484c094f229f5846db83

See more details on using hashes here.

Provenance

The following attestation bundles were made for rendu-0.1.2-py3-none-any.whl:

Publisher: release.yml on mborsalino/rendu

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page