07-08, 13:30–17:30 (US/Pacific), Ballroom D
Shiny is a framework for building web applications and data dashboards in Python.
In this workshop,
you will see how the basic building blocks of shiny can be extended to create
your own scalable production-ready python applications.
In particular, this workshop covers:
- Overview of the basic building blocks of a Shiny for Python application
- How to refactor applications into shiny modules
- How to write tests for your shiny application
- Deploy and share your application
At the end of this course you will be able to:
- Build a Shiny app in Python
- Refactor your reactive logic into Shiny Modules
- Identify when to write Shiny modules
- Write unit tests and end-to-end tests for your shiny application
- Deploy and share your application (for free!)
Shiny is a framework for building web applications and data dashboards in Python.
In this one-day workshop,
you will see how the basic building blocks of shiny can be extended to create
your own scalable production-ready python applications.
In particular, this workshop covers:
- 0-50: Overview of the basic building blocks of a Shiny for Python application
- How to refactor applications into shiny modules
- How to write tests for your shiny application
- Deploy and share your application
At the end of this course you will be able to:
- Build a Shiny app in Python
- Refactor your reactive logic into Shiny Modules
- Identify when to write Shiny modules
- Write unit tests and end-to-end tests for your shiny application
- Deploy and share your application (for free!)
The workshop will have both a lecture component and hands-on live coding practical component.
We will work together to build and understand one of our Shiny for Python's Dashboard Templates:
https://shiny.posit.co/py/templates/
Workshop Breakdown:
First Hour: Introduction
- :00-:20 Overview of the basic building blocks of a Shiny for Python application
- :20-:35 Input components
- :35-:50 Output components
- :50-1:00 break
Second Hour: Build a more complex app
- 1:00 1:35 A more complex application with multiple input and output components
- 1:35-1:50 Introduction to Shiny's reactivity programming model.
- 1:50-2:00 Break
3rd Hour: Refactoring your application and Shiny Models
- 2:00-2:15 Introduction to shiny modules
- 2:15-2:30 Refactor current app into modules
- 2:30-2:50 Import your Shiny Modules into the new application
- 2:50-3:00 Break
4th Hour: Testing and deployment
- 3:00-3:30 Testing your shiny apps with playwright
- 3:30-4:00 Deploying your application to the web (for free!)
Workshop preparation:
We will be using Positron in the workshop with the VSCode Shiny extension.
You can also use VSCode with the Shiny extension as well.
- Positron: https://positron.posit.co/
- VSCode: https://code.visualstudio.com/
- Shiny Extension: https://marketplace.visualstudio.com/items?itemName=Posit.shiny
You will need the following python packages installed. An example requirements.txt
:
faicons
shiny
shinywidgets
plotly
pandas
ridgeplot
ipykernel
FAQ
- What if I'm a complete beginner?
- You should have a basic understanding of Python and be able to install packages with pip, do basic data manipulation, and draw plots.
- What if I've never built a Shiny app before?
This workshops doesn’t require any Shiny or web application experience.
We'll focus more on practical examples in the course.
We do have additional resources for you to dive more into more Shiny details,
but we will cover the basics needed to build larger and scalable applications.
- Why should I learn Shiny if I already know Streamlit or Dash?
We believe that Shiny is the best framework for building data applications in Python.
It’s reactive execution model means that you can build performant applications without
explicitly caching data or managing application state.
See
this blog post
for more on why we think that Shiny is worth learning.
- I already know Shiny for R, is this workshop for me?
The R and Python Shiny packages are quite similar,
so some of the content in this workshop may be familiar to you.
That said it’s a great opportunity to fill in missing pieces and ask question about Python best practices.
We will also talk about Shiny modules and testing in this workshop,
which will also be a precursor for you to learn more or incorporate Python Packaging
to your Shiny applications.
At a minimum, a python environment with the pandas and shiny packages installed. See the proposal description for all the installation instructions
Prerequisites –We will be using Positron in the workshop with the VSCode Shiny extension.
You can also use VSCode with the Shiny extension as well.
- Positron: https://positron.posit.co/
- VSCode: https://code.visualstudio.com/
- Shiny Extension: https://marketplace.visualstudio.com/items?itemName=Posit.shiny
You will need the following python packages installed. An example requirements.txt
:
faicons
shiny
shinywidgets
plotly
pandas
ridgeplot
ipykernel
Daniel Chen is a data science educator working in developer relations at Posit, PBC, and a lecturer at the University of British Columbia. He specializes in teaching and advocating for modern data science tools and workflows.