A Streamlit application for forecasting stock prices using Prophet and yfinance.
- Data Loading: Fetches historical stock data (AAPL, GOOG, MSFT, GME) from Yahoo Finance.
- Data Visualization: Interactive plots of historical open and close prices using Plotly.
- Forecasting: Predicts future stock prices for up to 4 years using the Prophet model.
- Caching: Efficient data loading with Streamlit's caching mechanism.
- Python: 3.10+
- Streamlit: Web application framework.
- Prophet: Time series forecasting.
- yfinance: Market data downloader.
- Plotly: Interactive graphing library.
- Pandas: Data manipulation and analysis.
- Python 3.10 or higher
- pip
-
Clone the repository:
git clone https://github.com/yourusername/stock-forecasting.git cd stock-forecasting -
Create a virtual environment (optional but recommended):
python -m venv .venv source .venv/bin/activate # On Windows: .venv\Scripts\activate
-
Install the package in editable mode with development dependencies:
pip install -e .[dev]
Run the Streamlit app:
streamlit run src/stock_forecasting/app.pyOpen your browser at http://localhost:8501.
pytestThis project uses Ruff for linting and formatting.
ruff check .
ruff format .mypy srcThe application is structured as follows:
src/stock_forecasting/: Source code.app.py: Main Streamlit application entry point.utils.py: Utility functions for data loading, model training, and forecasting.
tests/: Unit tests.
MIT