This repository contains the code examples and applications for the "Streamlit 101" YouTube tutorial series. It's designed to help you learn Streamlit by exploring various features and building a comprehensive multi-page stock analysis dashboard.
The primary goal of this repository is to provide hands-on code for viewers of the Streamlit 101 tutorial series. It includes:
- Numerous small examples focusing on specific Streamlit functionalities (widgets, layout, data display, etc.).
- A flagship multi-page stock analysis dashboard (
Part_18_Multipage_Stock_Dashboard
) showcasing a more complex, real-world application.
The repository is organized into parts, where each Part_X_...
directory corresponds to a segment of the tutorial series and contains the relevant Streamlit code examples.
Part_1_write/
toPart_17_Advanced_MultiPage_Nav/
: These directories contain focused examples demonstrating specific Streamlit features such as text elements, data display, input widgets, media embedding, charting, layout options, chat elements, status indicators, navigation techniques, state management, connection secrets, caching, and custom components.Part_18_Multipage_Stock_Dashboard/
: This directory houses a comprehensive multi-page stock analysis dashboard.Part_18_Multipage_Stock_Dashboard-dev/
: A development or alternative version of the stock dashboard.context_portal/
: Contains files related to a context portal, possibly for managing or accessing data.- Root directory: Contains general project files like
.gitignore
,LICENSE
, and a globalrequirments.txt
for some of the simpler examples.
This is the main application built throughout the tutorial series, demonstrating how to create a sophisticated, interactive multi-page Streamlit app.
- Stock Overview: Real-time metrics, interactive candlestick charts, volume analysis, and performance summaries.
- Custom Ticker Input: Analyze any publicly traded stock by entering its ticker symbol.
- Real-Time Data: Fetches live market data from Yahoo Finance.
- Technical Analysis: Includes 15+ technical indicators (RSI, MACD, Bollinger Bands, etc.) with customizable parameters, trading signals, and trend analysis.
- Financial Statements: Analysis of income statements, balance sheets, and cash flow statements, along with key financial ratios and a financial health assessment. (Note: Full detailed statements are primarily for sample data; real-time data provides key metrics and ratios).
- Sentiment Analysis: News and social media sentiment tracking, market impact correlation, and sentiment trend visualization.
- Price Prediction: Machine learning models (ARIMA, Prophet, Linear Regression, Ensemble) for stock price forecasting, including model performance comparison and feature importance.
- Navigate to the dashboard directory:
cd Part_18_Multipage_Stock_Dashboard
- Install the specific dependencies for the dashboard:
Key dependencies include:
pip install -r requirements.txt
streamlit, pandas, numpy, plotly, ta-lib, pandas-ta, scikit-learn, prophet, yfinance
. - Run the Streamlit application:
streamlit run 18_app.py
- Open your web browser and go to
http://localhost:8501
.
Refer to Part_18_Multipage_Stock_Dashboard/README.md
for more detailed information on this specific application.
The directories named Part_1_write
, Part_2_Text
, Part_3_Data_Elements
, etc., contain smaller, self-contained Streamlit applications. These are designed to illustrate individual Streamlit functionalities covered in the tutorials. Users are encouraged to explore these parts to understand specific features in isolation.
To run any of the individual Streamlit apps within the subdirectories (e.g., Part_1_write
):
- Navigate to the specific part's directory:
cd Part_X_Directory_Name
- Run the Streamlit application, which is typically named
app.py
or follows apX_... .py
pattern:(Replacestreamlit run app.py
app.py
with the actual main Python file name if different for a particular part).
- Basic dependencies for some of the simpler tutorial parts are listed in the root
requirments.txt
file (e.g.,streamlit, pandas, numpy, matplotlib
). You can install these using:pip install -r requirments.txt
- More complex applications, particularly the
Part_18_Multipage_Stock_Dashboard
, have their ownrequirements.txt
file within their respective directories. These should be used to install dependencies for that specific part to ensure all necessary libraries are available.
We welcome contributions and suggestions!
- If you find any issues or have ideas for improvements, please open an issue on the GitHub repository.
- If you'd like to contribute code, please fork the repository and submit a pull request with your changes.
This project is licensed under the terms of the LICENSE
file. Please see the LICENSE
file for more details.
Happy Streamlit-ing!