Streamlit for Data Science: Create interactive data apps in Python [2 ed.] 9781803248226

An easy-to-follow and comprehensive guide to creating data apps with Streamlit, including how-to guides for working with

144 27 14MB

English Pages 359 Year 2023

Report DMCA / Copyright

DOWNLOAD EPUB FILE

Table of contents :
Preface
Who this book is for
What this book covers
Acknowledgment
To get the most out of this book
Get in touch
An Introduction to Streamlit
Technical requirements
Why Streamlit?
Installing Streamlit
Organizing Streamlit apps
Streamlit plotting demo
Making an app from scratch
Using user input in Streamlit apps
Finishing touches – adding text to Streamlit
Summary
Uploading, Downloading, and Manipulating Data
Technical requirements
The setup – Palmer’s Penguins
Exploring Palmer’s Penguins
Flow control in Streamlit
Debugging Streamlit apps
Developing in Streamlit
Exploring in Jupyter and then copying to Streamlit
Data manipulation in Streamlit
An introduction to caching
Persistence with Session State
Summary
Data Visualization
Technical requirements
San Francisco Trees – a new dataset
Streamlit visualization use cases
Streamlit’s built-in graphing functions
Streamlit’s built-in visualization options
Plotly
Matplotlib and Seaborn
Bokeh
Altair
PyDeck
Configuration options
Summary
Machine Learning and AI with Streamlit
Technical requirements
The standard ML workflow
Predicting penguin species
Utilizing a pre-trained ML model in Streamlit
Training models inside Streamlit apps
Understanding ML results
Integrating external ML libraries – a Hugging Face example
Integrating external AI libraries – an OpenAI example
Authenticating with OpenAI
OpenAI API cost
Streamlit and OpenAI
Summary
Deploying Streamlit with Streamlit Community Cloud
Technical requirements
Getting started with Streamlit Community Cloud
A quick primer on GitHub
Deploying with Streamlit Community Cloud
Debugging Streamlit Community Cloud
Streamlit Secrets
Summary
Beautifying Streamlit Apps
Technical requirements
Setting up the SF Trees dataset
Working with columns in Streamlit
Exploring page configuration
Using Streamlit tabs
Using the Streamlit sidebar
Picking colors with a color picker
Multi-page apps
Editable DataFrames
Summary
Exploring Streamlit Components
Technical requirements
Adding editable DataFrames with streamlit-aggrid
Creating drill-down graphs with streamlit-plotly-events
Using Streamlit Components – streamlit-lottie
Using Streamlit Components – streamlit-pandas-profiling
Interactive maps with st-folium
Helpful mini-functions with streamlit-extras
Finding more Components
Summary
Deploying Streamlit Apps with Hugging Face and Heroku
Technical requirements
Choosing between Streamlit Community Cloud, Hugging Face, and Heroku
Deploying Streamlit with Hugging Face
Deploying Streamlit with Heroku
Setting up and logging in to Heroku
Cloning and configuring our local repository
Deploying to Heroku
Summary
Connecting to Databases
Technical requirements
Connecting to Snowflake with Streamlit
Connecting to BigQuery with Streamlit
Adding user input to queries
Organizing queries
Summary
Improving Job Applications with Streamlit
Technical requirements
Using Streamlit for proof-of-skill data projects
Machine learning – the Penguins app
Visualization – the Pretty Trees app
Improving job applications in Streamlit
Questions
Answering Question 1
Answering Question 2
Summary
The Data Project – Prototyping Projects in Streamlit
Technical requirements
Data science ideation
Collecting and cleaning data
Making an MVP
How many books do I read each year?
How long does it take for me to finish a book that I have started?
How long are the books that I have read?
How old are the books that I have read?
How do I rate books compared to other Goodreads users?
Iterative improvement
Beautification via animation
Organization using columns and width
Narrative building through text and additional statistics
Hosting and promotion
Summary
Streamlit Power Users
Fanilo Andrianasolo
Adrien Treuille
Gerard Bentley
Arnaud Miribel and Zachary Blackwood
Yuichiro Tachibana
Summary
Other Books You May Enjoy
Index

Streamlit for Data Science: Create interactive data apps in Python [2 ed.]
 9781803248226

  • 0 0 0
  • Like this paper and download? You can publish your own PDF file online for free in a few minutes! Sign Up
Recommend Papers