Python Data Visualization Transcripts
Chapter: Streamlit
Lecture: API summary
Login or
purchase this course
to watch this video and the rest of the course contents.
0:00
Now that we've gone through a simple example. Streamlit. I'll take a step back and talk about the API, as I mentioned, it is a relatively small API.
0:08
but very powerful for adding interactivity to your plots. We talked about using Stream lit the convention is to import streamlit as
0:17
ST. One of the other important functions that streamlit provides is a caching decorator that
0:22
is used to speed up and minimize the amount of time that you're loading data. So in this example when we load our
0:30
CSV File, the cache decorator will ensure that it's only loaded once or when it's needed. You can also use this for expensive calculations and this is
0:39
some of the benefit that streamlit provides doing this all behind the scenes with the simple decorator. Streamlit also allows us to display text.
0:47
We showed the title example and there are several other examples for showing text or other types of visualizations to the user.
0:55
The real power of streamlit is using the widgets and these are different forms for getting
1:00
user input that you can then use to filter and change your data. A lot of the common ones that you expect here such as a text area input, data, input,
1:08
a multi select or other which is really useful for controlling that input from the user
1:14
And then finally Streamlit doesn't have a whole lot of flexibility when it comes
1:19
to the layout but there are some options such as the sidebar columns and expander and
1:25
a container and this is an area that there is a lot of active development in the streamlit API.