Loading repository data…
Loading repository data…
danrgonzalez / repository
Comprehensive Python-based stock data analysis tool with interactive dashboard for quarterly financial data visualization and comparison
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
A comprehensive Python-based stock data analysis tool that processes quarterly financial data and provides an interactive dashboard for visualization and comparison.
This workflow consists of three main components:
stock_indexer.py) - Processes raw stock data and adds time-based indexingstock_dashboard.py) - Interactive Streamlit dashboard for data visualizationrun_stock_analysis.py) - Automated script to run both components sequentiallyIf you're using conda and have the stockinsights environment set up:
source setup_env.sh
python run_stock_analysis.py
This will automatically:
# Step 1: Process the raw data
python stock_indexer.py
# Step 2: Launch the dashboard
streamlit run stock_dashboard.py
StockData.xlsx - Your raw quarterly stock data filestock_indexer.py - Data processing scriptstock_dashboard.py - Dashboard applicationstock_classifications.py - Stock sector/industry classifications (optional)run_stock_analysis.py - Workflow automation scriptInstall the required packages:
pip install pandas streamlit plotly numpy pydantic
Or install from a requirements file:
pip install -r requirements.txt
For code formatting and quality tools:
pip install -r requirements-dev.txt
pre-commit install
requirements.txt:
pandas>=1.5.0
streamlit>=1.28.0
plotly>=5.15.0
numpy>=1.24.0
pydantic>=2.0.0
openpyxl>=3.1.0
Your StockData.xlsx file should contain the following columns:
| Ticker | Report | EPS | Revenue | Price | DivAmt |
|---|---|---|---|---|---|
| AAPL | 2023-Q1 | 2.18 | 117154 | 157.96 | 0.24 |
| AAPL | 2023-Q2 | 1.26 | 81797 | 193.97 | 0.24 |
| GOOGL | 2023-Q1 | 1.17 | 69787 | 108.22 | 0.00 |
stock_indexer.py)Purpose: Processes raw stock data and adds sequential indexing for time-series analysis.
What it does:
StockData.xlsxIndex column for each ticker (1 = oldest, N = newest)StockData_Indexed.xlsxKey Features:
Output: StockData_Indexed.xlsx with added Index column
stock_dashboard.py)Purpose: Interactive web-based dashboard for stock data analysis and visualization.
Features:
Individual Analysis Tab:
Multi-Ticker Comparison Tab:
Rolling Averages Summary Tab:
Access: Opens automatically in your default web browser at http://localhost:8501
run_stock_analysis.py)Purpose: Automates the entire workflow with dependency checking and error handling.
Features:
The dashboard has three main tabs:
📋 Individual Analysis
📊 Multi-Ticker Comparison
📈 Rolling Averages Summary
1. "File not found" errors:
ERROR: StockData.xlsx not found in current directory!
Solution: Ensure StockData.xlsx is in the same folder as the scripts.
2. Missing dependencies:
ERROR: Missing required packages: streamlit, plotly
Solution: Install missing packages with pip install streamlit plotly
3. Data format issues:
ERROR: Core data verification failed!
Solution: Check that your Excel file has the required columns (Ticker, Report, EPS, Revenue, Price).
4. Port already in use:
Error: Port 8501 is already in use
Solution:
streamlit run stock_dashboard.py --server.port 8502The indexer performs several validation checks:
your_project_folder/
├── StockData.xlsx # Input data file
├── StockData_Indexed.xlsx # Generated by indexer
├── stock_indexer.py # Data processing script
├── stock_dashboard.py # Dashboard application
├── stock_classifications.py # Sector classifications (optional)
├── run_stock_analysis.py # Workflow automation
├── requirements.txt # Python dependencies
└── README.md # This file
Data Preparation:
Performance:
Analysis:
run_stock_analysis.py)StockData.xlsxstock_classifications.pyWhen you have new quarterly data:
StockData.xlsx with new recordspython stock_indexer.pyIf you encounter issues:
pip install pandas streamlit plotly numpy pydantic openpyxl)StockData.xlsx in the project folderpython run_stock_analysis.pyhttp://localhost:8501Happy analyzing! 📈✨