1

Install the Preswald SDK

pip install preswald
Need the latest version? Upgrade anytime:
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: A starter Python script to get you going.
  • preswald.toml: Your app’s configuration settings.
  • secrets.toml: A secure place for sensitive data.
  • .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

text("# Welcome to Preswald")

Run It Locally

Launch your app locally with this command:

preswald run hello.py

Open your browser and navigate to http://localhost:8501. Your app will be live, ready for you to explore and iterate on.

4

Deploy Your App

When you’re ready to deploy your app, Preswald gives you flexibility:

Deploy Locally

If you just want to test your container locally:

preswald deploy --target local hello.py

Or simply:

preswald deploy hello.py

This performs a local “dry run” by building the container locally.