1

Install the Preswald SDK

pip install preswald

or 

uv pip install preswald
Need the latest version? Upgrade anytime:
pip install --upgrade preswald

or 

uv pip install --upgrade preswald
2

Set Up Your First Project

Run these commands to bootstrap your first Preswald app:

preswald init my_project
cd my_project

This will create a scaffolded project with the following:

  • hello.py: Your main Python script where you’ll write your app logic
  • preswald.toml: Configuration for your app’s metadata, runtime settings, and branding
  • secrets.toml: Secure storage for sensitive data like API keys
  • data/: Directory for your input data files
  • images/: Directory for custom branding assets
  • .gitignore: Pre-configured to exclude sensitive files from version control
3

Write Your First App

Open hello.py and edit it with the following content:

from preswald import text, table, get_df

# Add a title
text("# Welcome to Preswald")

# Load and display data
df = get_df("data/sample.csv")
table(df)

This simple example demonstrates Preswald’s key features:

  • Python-based development with built-in UI components
  • Direct data access with DuckDB integration
  • Reactive updates powered by Pyodide in the browser

Run It Locally

Launch your app locally with this command:

preswald run

Open your browser and navigate to http://localhost:8501. Your app will run entirely in the browser, with no server required.

4

Export Your App

When you’re ready to share your app, export it as a static site:

preswald export

This creates a dist/ folder containing your complete app, including:

  • All Python code (bundled via Pyodide)
  • Data files and DuckDB queries
  • UI components and styling
  • Everything needed to run offline in any modern browser

You can now share this folder directly or host it on any static hosting platform.