← Tutorials
Beginner~10 min

Create a slide deck with OpenSlides

Generate branded presentations from a text prompt or Python script. No PowerPoint, no Figma, no templates.

What you'll get

A complete slide deck with your brand colors, fonts, and logo. Exported as PNG images or PDF. The whole process takes about 2 minutes.

  • Auto-extract brand colors and fonts from any website
  • Full creative control via HTML/CSS (no theme fighting)
  • Export to PNG or PDF
  • ~300 lines of code, easy to understand and customize

Prerequisites

  • 1.Python 3.9 or higher

Step 1: Install

pip install openslides-ai

playwright install chromium

Optional: pip install aiohttp for brand extraction from URLs.

Step 2: Extract your brand

Point OpenSlides at any website and it auto-extracts colors, fonts, and logo:

from openslides import Brand, export, base_html

brand = Brand.from_domain("stripe.com")

print(brand.primary) # "#635bff"

print(brand.font_headline) # "Inter"

Or define brand values manually if you prefer:

brand = Brand(

primary="#054dfe",

background="#fdfbf5",

text="#191919",

font_headline="Syne",

font_body="Inter",

)

Step 3: Write your slides

Each slide is a Python function that returns HTML. Use f-strings to inject brand values:

def slide_hero():

return f'''

{base_html(brand)}

<body style="background:{brand.background}">

<h1 style="color:{brand.text}">

Your headline here

</h1>

</body></html>

'''

No abstractions to learn. It's just HTML with your brand values injected. If you can write a webpage, you can make slides.

Step 4: Export

slides = [slide_hero(), slide_solution(), slide_cta()]

# Export to PNG

export(slides, "/tmp/my-deck/")

# Or export to PDF

export(slides, "/tmp/my-deck/", format="pdf")

That's it. Your slides are in /tmp/my-deck/ as slide-01.png, slide-02.png, etc.

CLI alternative

Prefer the command line? Save your slides as a Python file and build from the terminal:

# Build to PNG

openslides build my_deck.py -o /tmp/output/

# Build to PDF

openslides build my_deck.py -o /tmp/output/ -f pdf

# Custom dimensions

openslides build my_deck.py -W 1280 -H 720

Next steps

  • Check the examples/ folder in the repo for full deck examples.
  • The library is ~300 lines. Read it, understand it, make it yours.
  • Use an AI coding tool to generate slides from a text prompt (describe what you want, it writes the HTML).