UV and the Environment
- We can use
uvto create a new Python project withuv init. - We can add dependencies to our project with
uv add {package-name}. -
uvautomatically creates and manages a virtual environment for our project, aiding with reproducibility and avoiding conflicts between projects.
Introduction to Streamlit
- We can run a Streamlit app with
uv run streamlit run {script-name}.py. - Streamlit automatically detects changes to our code and updates the app in real time.
- We can write text to our app using
st.writeandst.markdown. -
st.writecan take in a wide variety of data types and will intelligently display them. - Streamlit has a variety of built-in widgets that we can use to add interactivity to our app.
Getting Data from an API
- APIs allow us to get data from web services and incorporate it into our applications.
- We can use the
requestslibrary to make HTTP requests to APIs and get data back in JSON format. - Streamlit widgets can be used to get user input and use that input to make API requests, allowing us to create interactive applications that incorporate live data.