Skip to content

Click on the website link to view instructions on how to check your Streamlit setup

License

Notifications You must be signed in to change notification settings

hsma-programme/h6_7b_web_apps_1

Repository files navigation

HSMA 6 - Session 7B - Introduction to Web Apps

Instructions if running from github codespaces

If you are using github codespaces, you will need to add some extra arguments when running your app.

streamlit run my_app.py --server.enableCORS false --server.enableXsrfProtection false

Learning Objectivs

At the end of this session, students should be able to:

  • Explain the basics of how a Streamlit app runs
  • Create a Streamlit app containing
    • Titles and text
    • Images
    • Dataframes
    • Static or Interactive Charts
    • Static or Interactive Maps
    • Metrics
    • Layout elements (tabs, columns, expanders, callouts)
    • File uploading
    • Chart, Map or data file downloading
  • Explain some of the pros and cons of Streamlit versus other Python app frameworks, such as Plotly Dash, Shiny for Python, and Flask

In this session, students will create three web applications:

  • a simple calculator
  • a wordcloud generator
  • a dashboard

Slides

Google Slides - Click here to view slides for this session

Book

Book - Click here to view the relevant HSMA book

Dataset Sources

Exercise 3

Olympic Events and Results

https://www.kaggle.com/datasets/heesoo37/120-years-of-olympic-history-athletes-and-r (CC0 1.0 Universal)

World Population

https://data.worldbank.org/indicator/SP.POP.TOTL (Creative Commons Attribution 4.0 (CC-BY 4.0))

World Country Centroids

https://github.com/gavinr/world-countries-centroids (MIT License)

Copyright (c) 2021 Gavin Rehkemper

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

World Country Outlines

https://github.com/johan/world.geo.json/tree/master

Penguins

Size measurements, clutch observations, and blood isotope ratios for 344 adult foraging Adélie, Chinstrap, and Gentoo penguins observed on islands in the Palmer Archipelago near Palmer Station, Antarctica. Data were collected and made available by Dr. Kristen Gorman and the Palmer Station, Antarctica Long Term Ecological Research (LTER) Program.

Data are available by CC-0 license in accordance with the Palmer Station LTER Data Policy and the LTER Data Access Policy for Type I data.

Imported via the palmerpenguins package, created by Muhammad Chenariyan Nakhaee.

About

Click on the website link to view instructions on how to check your Streamlit setup

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published