Shiny for Python Live Coding Video Series

2025-05-07
"Graphic featuring the Shiny logo, Python logo, and a portrait of Keith Galli.

Level up your Python

Interested in more valuable Python tutorials and updates? Join our email list.

Keith Galli’s Shiny for Python video series is for Python developers and data scientists who want to build and deploy interactive web applications and dashboards easily using their existing Python knowledge.

If you’re unfamiliar with Shiny, it allows you to rapidly create well-designed, interactive web applications and share your Python-based data-driven insights directly through a polished web interface without needing extensive web development expertise.

Watching live coding demos is a dynamic way to grasp tools in action, seeing firsthand how code translates into deployed Shiny apps. And so, Keith Galli has created a comprehensive video series demonstrating how to leverage Shiny capabilities with Python. 

You can find the full Shiny with Python series playlist here. This series is broken down into five videos. Let’s explore what each one covers.

 

How to Build, Deploy, & Share a Shiny for Python Application in 20 minutes

 

YouTube Video (22:15) | GitHub Repo

This video introduces Shiny, a framework that simplifies the creation of interactive web apps with Python. 

  • You can use Shiny to create basic dashboards and complex web applications. Look through the Shiny Gallery to get a glimpse of the possibilities: example dashboards, data explorers, and more.
  • Keith’s tutorial demonstrates how to quickly build a basic Shiny app with Shinylive (a free online playground) by loading your own data (like a CSV file) and creating interactive visualizations such as histograms and bar charts. It also covers how to instantly share your app via a unique, encoded URL. 
  • For developing more sophisticated applications, the video guides you through setting up a local Python environment, installing necessary libraries like shiny and shinywidgets using a requirements.txt file, and using a code editor. 
  • You’ll see an example of building a sales dashboard with interactive elements, such as an input slider that controls the number of displayed items. 
  • Finally, the video explains the steps to deploy your Shiny application to the web using shinyapps.io, making it accessible through a public link.

 

Reactivity in Shiny: How to Make Interactive Python Dashboards

 

YouTube Video (35:03) | GitHub Repo

This video focuses on building interactive Python dashboards using the Shiny framework, specifically delving into reactivity. 

  • The tutorial provides an in-depth understanding of Shiny’s reactivity model, demonstrating how changes in input variables trigger updates only in the affected components, leading to efficient rendering. 
  • The video showcases the implementation of various input selectors, such as numeric inputs and selectize for multiple inputs for cities. It walks through the process of building reactive components and visualizations, including adding a new Plotly chart showing sales over time, filtered by city based on the selected input. The video introduces reactive calculations for efficient data manipulation and caching. It also covers adding and formatting plots with Plotly, including grouping data, setting titles, and dynamically changing bar colors using a checkbox input. 
  • Finally, we’ll walk through the documentation for various types of reactivity available in Shiny, such as reactive effect (similar to reactive calc but with no return), reactive event (updates only on specific events like button clicks), reactive isolate (prevents updates during recalculations), and reactive invalidate_later (for periodic recalculations). 

 

Layouts in Shiny: How to Make Your Python Dashboard Look Professional

 

YouTube Video (33:26) | GitHub Repo

This video focuses on enhancing the aesthetics and organization of Python Shiny dashboards by using different layout components. 

  • Quickly get started by implementing layout templates available on the Shiny for Python docs site, which provide pre-designed structures that can adapt to your app. 
  • Use cards to group related elements and sidebars to house input controls, contributing to a cleaner and more professional user interface. 
  • Utilize columns and grids through ui.layout_columns and ui.layout_columns_wrap to achieve better data presentation by arranging dashboard elements in a structured and responsive manner. 
  • Incorporate tab options using components like navSetCardUnderline, enabling multiple views and content sections within a single, easy-to-navigate dashboard

 

How to Combine Matplotlib, Plotly, Seaborn, & More in a Single Python Dashboard

 

YouTube Video (31:03) | GitHub Repo

This fourth video in the Shiny for Python series demonstrates how to integrate various Python visualization libraries like Matplotlib and Seaborn for creating detailed static plots within Shiny dashboards. 

  • Use Altair and Plotly for dynamic and interactive charts, leveraging Shiny’s support for IPython widgets through render_plotly and render_altair annotations. 
  • Implement Folium for interactive maps using the render_ui function due to its HTML representation.
  • Customize data tables with features like filtering and row selection using render_data_grid and render_data_table. 

 

How to Perfect Your Python Dashboard With Advanced Styling (HTML & CSS)

 

YouTube Video (47:09) | GitHub Repo

This video focuses on advanced styling techniques to enhance the visual appeal and professionalism of your Shiny dashboards. 

  • Add a logo and custom title by manipulating HTML elements like div and img. 
  • Directly modify HTML and CSS within Shiny apps using ui.tags.style, allowing for targeted styling of components by using CSS classes and IDs. 
  • Customizing Altair charts to achieve a polished look by removing grid lines, capitalizing axis labels, and changing font colors. 
  • Advanced Plotly chart modifications, such as implementing color spectra, removing legends, and standardizing font styles, and how to apply a consistent color theme across different chart types (Altair, Plotly, Folium heatmaps).

 

Shiny for Python Series Coda

 

This series explores creating professional dashboards and web apps with Shiny for Python. While a five-part, nearly three-hour series may seem comprehensive, we are just scratching the surface in terms of how Shiny may benefit you. We hope it empowers you to explore Shiny today.

Check out the Shiny docs site at https://shiny.posit.co/py/ and the Shiny Blog to stay up to date on Shiny’s rapid development at https://shiny.posit.co/blog/.

Join our email list for more valuable Python tutorials and updates.