--> Link to the udemy course on Streamlit 🎉
This project is part of the Streamlit.io training course that I propose with a double objective:
- Learn how to use Streamlit.io, a Python framework that allows to develop data/ML applications and commonly used by Data Scientists.
- Develop a web application to analyze the stock prices of S&P500 companies.
Here is a preview of the final version of the application developed in this directory :
Step 1 : S&P500 Screener
Step 2 : S&P500 Stock Analysis
If you want to see the final application in production, click here !
Here is the architecture of the course directory :
The initial_version
directory contains the same files as the final_version
directory. The difference is that the files in the initial_version
directory are empty and will be completed with the explanations during the training.
You will find all the answers in the final_version
directory.
Then, within these 2 folders, you will find :
- An
exercise
folder: With all the exercises of the course. - A
project
folder in which you will find the 3 successive steps of the final project (the S&P500 screener and stock analysis application) :final_project_basics.py
/final_project_interactions.py
/final_project.py
In order to work on this directory, you have to download it locally on your own computer.
To do this, open a terminal and place yourself in the folder of your choice in order to store the project folder (with the cd
command) then clone the folder by executing the command :
git clone https://github.com/pierre-louis-danieau/udemy_streamlit.git
Congratulations, you should see the directory appear locally on your computer. You can now open the project with your favorite editor (VScode, Pycharm, Spyder...)!
The exercises
folder is composed of 4 subfolders:
- streamlit_basics : Python file on the basics of streamlit + input files (an audio recording, a photo, a video)
- streamlit_interactions : Python file for training on streamlit widgets which allow to interact with the user.
- streamlit_visualizations : Python file for training on how to create graphics in streamlit.
- streamlit_advanced_features : Python file for training on the more advanced components of streamlit.
The project
folder is composed of 5 subfiles:
You will find :
final_project_basics.py
: The first step of the application with what was seen in the streamlit_basics training part.final_project_interactions.py
: The second step of the application with what was seen in the streamlit_interactions training part.final_project.py
: The third and last step of the application with what was seen in the streamlit_visualizations and streamlit_advanced_features training part.- s&p500.csv: The csv file of most of the S&P500 companies with some indicators like market capitalization, dividend ratio...
- stock.jpeg: A picture used in the layout of the application.
In order to run the all the python files, you need to create a virtual environment and install the dependencies that are in the requirements.txt
file.
To do this:
- Open a terminal and go to the repository folder:
cd udemy_streamlit
- Install virtualenv :
pip install virtualenv
- Create the virtual environment :
virtualenv env
- Activate it :
source env/bin/activate
- Install dependencies :
pip install -r requirements.txt
Once the installation of the dependencies is finished, you can run all the python files with the command : streamlit run path_to_file/file_name.py
.
For example, to run the final application, execute :
streamlit run final_version/project/final_project.py
And to run the first code exercice (the streamlit foundation in the streamlit_basics
repository):
streamlit run final_version/exercices/streamlit_basics/basic.py
You should then see a web window with the streamlit application!
PS : The version of Python used during this training is : 3.9.6
🎉🎉 That's it, you normally have all the elements to work on this repository yourself ! 🎉🎉
--> Link to the udemy course on Streamlit
Happy training !