This guide provides step-by-step instructions to set up and run the Enhanced Stock Analysis Dashboard.
- Python 3.8 or higher
- Pip package manager
- Git (optional, for cloning the repository)
- Alpha Vantage API key (free tier available)
Option 1: Using Git
git clone https://github.com/yourusername/enhanced-stock-dashboard.git
cd enhanced-stock-dashboardOption 2: Manual Download
- Download the ZIP file of the repository
- Extract to your preferred location
- Open a terminal/command prompt and navigate to the extracted folder
On Windows:
python -m venv venv
venv\Scripts\activateOn macOS/Linux:
python3 -m venv venv
source venv/bin/activatepip install -r requirements.txt- Create a
.streamlitdirectory in the project root if it doesn't exist:
mkdir -p .streamlit- Create a
secrets.tomlfile inside the.streamlitdirectory:
touch .streamlit/secrets.toml- Add your Alpha Vantage API key to the
secrets.tomlfile:
A_KEY = "your_alpha_vantage_api_key"streamlit run app.pyThe dashboard should open automatically in your default web browser at http://localhost:8501.
Ensure your project has the following structure:
enhanced-stock-dashboard/
├── .streamlit/
│ └── secrets.toml
├── app.py
├── data_fetcher.py
├── technical_analysis.py
├── visualizations.py
├── financial_analysis.py
├── sentiment_analysis.py
├── recommendation_engine.py
├── portfolio_tracker.py
├── requirements.txt
└── README.md
- Go to Alpha Vantage
- Fill out the form to get a free API key
- Copy the key into your
secrets.tomlfile as shown above
If you see an error like ModuleNotFoundError: No module named 'xyz':
pip install xyzIf you get an error about missing API keys:
- Verify your
secrets.tomlfile is in the correct location - Check the API key is correctly formatted with no extra spaces
- Restart the Streamlit server
- Consider upgrading to a paid API tier for higher rate limits
- Adjust the caching TTL in
data_fetcher.pyif needed
- Some stocks may have limited data availability
- Check if the ticker symbol is correct
- Try a different stock to verify the API connection
- Push your code to a GitHub repository
- Go to Streamlit Cloud
- Connect your GitHub account
- Select your repository and deploy
- Add your API keys in the Streamlit Cloud secrets management section
- Create a Dockerfile:
FROM python:3.9-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
CMD ["streamlit", "run", "app.py"]- Build and run the Docker container:
docker build -t stock-dashboard .
docker run -p 8501:8501 stock-dashboardTo update the dashboard to the latest version:
- Pull the latest changes (if using Git):
git pull origin main- Update dependencies:
pip install -r requirements.txt --upgrade- Restart the application:
streamlit run app.py