Hello World

Display a simple “Hello, World!” message using Preswald:

from preswald import text

text("# Hello, World!")

Data Viewer

Connect to a CSV file and display the data using Preswald’s viewer:

from preswald import connect, get_df, table

connect() # reads preswald.toml
data = get_df("example_data")
table(data)

Connect to a JSON file and display the data using Preswald’s viewer:

from preswald import connect, get_df, view

connect() # reads preswald.toml
data = get_df("user_event")
view(data)

Interactive Dashboard

Create an interactive dashboard where users can control how many rows of data to display:

from preswald import text, slider, table

text("# Interactive Dashboard")

rows = slider("Rows to Display", min_val=5, max_val=50, default=10)
table(data, limit=rows)

Learn More

To explore these examples in depth and discover additional use cases, check out the Preswald Examples. You’ll find comprehensive guides and example projects to help you make the most of Preswald.