/streamlit_saffron

Streamlit tutorial

Primary LanguagePythonMIT LicenseMIT

Learning Streamlit with Penguins 🐧

In the Pythonic realm πŸπŸ‘‘ of data and machine learning web application frameworks Streamlit has been acquiring quite a lot of popularity. In fact, Streamlit is designed to be incredibly user-friendly. You can create interactive web apps with just a few lines of Python code. It abstracts away much of the complexity involved in web development, making it accessible even to those without a web development background.

How to use this repo πŸ›Ή

Please fork this repo and then check the milestones list below. This repo will guide us step-by-step on building a πŸ“ŠπŸ§‘πŸ½β€πŸ”¬DataScience Web Application πŸ§‘πŸ½β€πŸ”¬πŸ“Š based on Streamlit.

πŸ—Ώ Milestones πŸͺœ πŸŽ―πŸ‘·πŸ½β€β™€οΈ:

  1. Setting up a python environment 🐍
  2. πŸ”₯πŸ”₯ 2 Warm-Up Exercises πŸ”₯πŸ”₯ on EDA πŸ“ŠπŸŒˆ and Deploy a Machine-Learning Model πŸŽ“πŸ€–
  3. βš‘οΈπŸ“š Quick Reading on Streamlit βš‘οΈπŸ“š
  4. Building a 🐧 Web-App with Streamlit: PART I
  5. Building a 🐧 Web-App with Streamlit: PART II

Branches 🌱

This repository contains several branches, each serving a different purpose:

  • main: This is the main branch and contains the step-by step guidance for building the streamlit app.
  • team_gentoo_eda: This is the branch used to implement the eda feature
  • team_adelie_predict: This is the branch used to implement the model predict feature
  • main-dev: This is the branch where we merge all the new features into
Further branches πŸ¦‹
  • streamlit_advanced: Contains streamlit advanced concepts.

  • solution_streamlit: A branch with the solution for the Streamlit exercise.

  • solution_excercise: A branch with the solution for the EDA exercise related to the application.

Feel free to explore the different branches.

Environment πŸŒ€ and Installation πŸ‘©πŸ½β€πŸ”§πŸ‘¨πŸ½β€πŸ”§

Prerequisite

  • Python 3.11.3 or above up to 3.11.6 (We will use pyenv for Python Version Management but feel free to use any other tool)
  • Virtual environment (We will use the module venv from python but you can use any other tool)

For MacOs/Linux users

# Sets the local Python version to 3.11.3 using pyenv
pyenv local 3.11.3 
# Create a Virtual Environment named .streamlit_env using venv
python -m venv .streamlit_env
# Activate the Virtual Environment
source .streamlit_env/bin/activate
# Install Streamlit and Additional Libraries
pip install -r requirements.txt

For Windows users with PowerShell CLI

# Sets the local Python version to 3.11.3 using pyenv
pyenv local 3.11.3 
# Create a Virtual Environment named .streamlit_env using venv
python -m venv .streamlit_env
# Activate the Virtual Environment
.streamlit_env\Scripts\Activate.ps1
# Install Streamlit and Additional Libraries
pip install -r requirements.txt

For Windows users with GIT-BASH CLI

# Sets the local Python version to 3.11.3 using pyenv
pyenv local 3.11.3 
# Create a Virtual Environment named .streamlit_env using venv
python -m venv .streamlit_env
# Activate the Virtual Environment
source .streamlit_venv/Scripts/activate
# Install Streamlit and Additional Libraries
pip install -r requirements.txt

πŸ§ͺ Test Streamlit Installation πŸ‘¨πŸ½β€πŸ”§πŸ‘©πŸ½β€πŸ”§

You can check if Streamlit is installed correctly and run a sample app with the following command:

streamlit hello

This should open a Streamlit web app in your default web browser.

Further Readings πŸ“š

The following is a list of other popular python web framework:


Both FastAPI and Flask are primarily focused on backend development for web applications.

Aknowledgments πŸ™πŸΌ

I would like to thank Dr. Paula GonzΓ‘lez Avalos for having introduced me into the Penguins and Streamlit worlds.

License

The MIT license