Skip to content

Preswald is a framework for building and deploying interactive data apps, internal tools, and dashboards with Python. With one command, you can launch, share, and deploy locally or in the cloud, turning Python scripts into powerful shareable apps.

License

Notifications You must be signed in to change notification settings

StructuredLabs/preswald

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Banner

Turn Python scripts into interactive data apps and deploy them anywhere in one command.

Apache 2.0 License Python Version Slack Community PyPI Version

Website Documentation Studio Book a Demo

What is Preswald?

Preswald is an open-source framework for building data apps, dashboards, and internal tools with just Python. It gives you pre-built UI components like tables, charts, and forms, so you donโ€™t have to write frontend code. Users can interact with your app, changing inputs, running queries, and updating visualizations, without you needing to manage the UI manually.

Preswald tracks state and dependencies, so computations update only when needed instead of re-running everything from scratch. It uses a workflow DAG to manage execution order, making apps more predictable and performant. Preswald lets you turn Python scripts into shareable, production-ready applications easily.

Key Features

  • Add UI components to python scripts โ€“ Drop in buttons, text inputs, tables, and charts that users can interact with.
  • Stateful execution โ€“ Automatically tracks dependencies and updates results when inputs change.
  • Structured computation โ€“ Uses a DAG-based execution model to prevent out-of-order runs.
  • Deploy with one command โ€“ Run preswald deploy and instantly share your app online.
  • Query and display data โ€“ Fetch live data from databases, or local files and display it in a UI.
  • Build interactive reports โ€“ Create dashboards where users can change filters and see results update.
  • Run locally or in the cloud โ€“ Start your app on your laptop or host it in Preswald Cloud for easy access.
  • Share with a link โ€“ No need to send scripts or install dependenciesโ€”just share a URL.
  • High-performance GPU charts โ€“ Render real-time, interactive charts using fastplotlib, with offscreen GPU acceleration and WebSocket-based streaming to the browser.


๐Ÿš€ Getting Started

Installation

First, install Preswald using pip. https://pypi.org/project/preswald/

pip install preswald

or 

uv pip install preswald

Demo GIF

๐Ÿ‘ฉโ€๐Ÿ’ป Quick Start

1. Initialize a New Project

Start your journey with Preswald by initializing a new project:

preswald init my_project
cd my_project

This will create a folder called my_project with all the basics you need:

  • hello.py: Your first Preswald app.
  • preswald.toml: Customize your appโ€™s settings and style.
  • secrets.toml: Keep your API keys and sensitive information safe.
  • .gitignore: Preconfigured to keep secrets.toml out of your Git repository.

2. Write Your First App

Time to make something magical! Open up hello.py and you should see something like this:

from preswald import text, plotly, connect, get_df, table
import pandas as pd
import plotly.express as px

text("# Welcome to Preswald!")
text("This is your first app. ๐ŸŽ‰")

# Load the CSV
connect() # load in all sources, which by default is the sample_csv
df = get_df('sample_csv')

# Create a scatter plot
fig = px.scatter(df, x='quantity', y='value', text='item',
                 title='Quantity vs. Value',
                 labels={'quantity': 'Quantity', 'value': 'Value'})

# Add labels for each point
fig.update_traces(textposition='top center', marker=dict(size=12, color='lightblue'))

# Style the plot
fig.update_layout(template='plotly_white')

# Show the plot
plotly(fig)

# Show the data
table(df)

3. Run Your App

Now the fun partโ€”see it in action! Run your app locally with:

preswald run

This command launches a development server, and Preswald will let you know where your app is hosted. Typically, itโ€™s here:

๐ŸŒ App running at: http://localhost:8501

Open your browser, and voilร โ€”your first Preswald app is live!

4. Deploy Your App to the Cloud

Preswald provides its own cloud platform for hosting and sharing your applications. You can authenticate with GitHub, create an organization, and generate an API key at app.preswald.com. Once set up, deploying is as simple as running:

preswald deploy --target structured

The first time you deploy, you'll be prompted to enter your GitHub username and Preswald API key. After that, your app will be built, deployed, and accessible online.

๐ŸŒ App deployed at: https://your-app-name-abc123.preswald.app

Now your app is live, shareable, and scalableโ€”without any extra setup.

๐Ÿ”ง Configuration

Preswald uses preswald.toml for project settings and theming. Itโ€™s straightforward, and it makes your app look polished.

Sample preswald.toml:

[project]
title = "Preswald Project"
version = "0.1.0"
port = 8501
slug = "preswald-project"
entrypoint = "hello.py"

[branding]
name = "Preswald Project"
logo = "images/logo.png"
favicon = "images/favicon.ico"
primaryColor = "#F89613"

[data.sample_csv]
type = "csv"
path = "data/sample.csv"

[logging]
level = "INFO"  # Options: DEBUG, INFO, WARNING, ERROR, CRITICAL
format = "%(asctime)s - %(name)s - %(levelname)s - %(message)s"

๐Ÿ“š Documentation

Weโ€™re here to help! Check out our full documentation at Preswald Docs.


๐Ÿค Contributing

Check out CONTRIBUTING.md.


๐ŸŽ‰ Join the Community

  • GitHub Issues: Found a bug? Let us know here.
  • Community Forum: Reach out here
  • Discussions: Share your ideas and ask questions in our discussion forum.
  • Contributors: Meet the awesome people who make Preswald better here.

๐Ÿ“ข Stay Connected

Follow us on LinkedIn Follow us on Twitter

๐Ÿ“„ License

Preswald is licensed under the Apache 2.0 License.

โœจ Contributors

Thanks to everyone who has contributed to Preswald ๐Ÿ’œ