Predicting stock prices based on the current market trend analysis
| Component | Technology |
|---|---|
| Language | Python 3.9+ |
| Web Framework | Streamlit |
| Stock Data | yfinance |
| LLM API | OpenAI GPT |
| Environment | python-dotenv |
unzip llm-stock-analyzer.zip -d llm-stock-analyzer
cd llm-stock-analyzerbash init.shThis will:
- Make all scripts executable
- Create virtual environment
- Install dependencies
- Prompt for your OpenAI API key
./run.shOpen browser at: http://localhost:8501
llm-stock-analyzer/
│
├── 🐍 Python Modules
│ ├── app.py # Main Streamlit application
│ ├── stock_data.py # Yahoo Finance data fetching
│ ├── llm_service.py # OpenAI API integration
│ ├── prompts.py # Prompt templates
│ └── config.py # Configuration management
│
├── 🔧 Shell Scripts
│ ├── init.sh # First-time initialization
│ ├── setup.sh # Full environment setup
│ ├── dev.sh # Developer quick restart
│ ├── test.sh # Test suite runner
│ └── run.sh # Production runner
│
├── ⚙️ Configuration
│ ├── requirements.txt # Python dependencies
│ ├── .env.example # Environment template
│ └── .gitignore # Git ignore rules
│
└── 📖 Documentation
└── README.md # This file
| Script | Command | Purpose |
|---|---|---|
| init.sh | bash init.sh |
First-time setup (run once) |
| setup.sh | ./setup.sh |
Reinstall environment |
| dev.sh | ./dev.sh |
Quick restart during development |
| dev.sh | ./dev.sh --demo |
Use demo data (no API calls) |
| test.sh | ./test.sh |
Run all tests |
| test.sh | ./test.sh --quick |
Skip API tests |
| run.sh | ./run.sh |
Run the application |
./test.sh./test.sh --quicksource venv/bin/activate
python -c "
from llm_service import validate_api_connection
success, message = validate_api_connection()
print(f'Status: {message}')
"429 Client Error: Too Many Requests
Fix: Use demo mode or wait 10-15 minutes
./dev.sh --demoIncorrect API key provided
Fix: Update your .env file with a valid key from https://platform.openai.com/api-keys
zsh: permission denied: ./setup.sh
Fix: Make scripts executable
chmod +x *.shTypeError: unsupported operand type(s) for |
Fix: Install compatible version
pip install yfinance==0.2.40When Yahoo Finance is rate-limiting, use demo mode with sample data:
./dev.sh --demoAvailable demo tickers:
AAPL- Apple Inc.GOOGL- Alphabet Inc.MSFT- Microsoft CorporationRELIANCE.NS- Reliance Industries (India)
- Go to https://platform.openai.com/api-keys
- Create a new API key
- Add to
.envfile:
OPENAI_API_KEY=sk-your-api-key-here| Market | Tickers |
|---|---|
| US | AAPL, GOOGL, MSFT, AMZN, TSLA, NVDA, META |
| India (NSE) | RELIANCE.NS, TCS.NS, INFY.NS, HDFCBANK.NS |
| UK (LSE) | HSBA.L, BP.L, VOD.L |