A comprehensive tool for screening, analyzing, and reporting on stocks, with a focus on penny stocks.
- Screen stocks based on financial metrics
- Fetch real-time stock data with Yahoo Finance
- Analyze options data for market sentiment
- Generate AI-powered analysis using Llama 3 via Ollama
- Save detailed investment reports and summaries
stock_screener/
│
├── analysis/ # Stock analysis components
├── config/ # Configuration settings
├── data/ # Data retrieval and processing
│ ├── simple_yahoo.py # Yahoo Finance integration
│ ├── stock_screener.py # Main screening logic
│ └── test_data.py # Sample data for testing
├── utils/ # Utility functions
└── main.py # Main entry point
- Clone the repository
git clone https://github.com/yourusername/stock_screener.git
cd stock_screener
- Create a virtual environment
python -m venv venv
-
Activate the virtual environment:
- Windows:
venv\Scripts\activate
- Mac/Linux:
source venv/bin/activate
- Windows:
-
Install requirements
pip install -r requirements.txt
- Install Ollama (for local LLM support)
- Follow instructions at Ollama's GitHub
- Pull the Llama 3 model:
ollama pull llama3:latest
- Copy the example environment file:
cp .env.example .env
- Edit the
.env
file and add your configuration:
YAHOO_MAX_RETRIES=3
YAHOO_TIMEOUT=10
# Run the full stock screener
python -m stock_screener.main
# Run stock fetching component
python run_specific_component.py --fetch
# Run stock screening component
python run_specific_component.py --screen
# Run AI analysis component
python run_specific_component.py --analyze
# Run a single stock analysis test
python test_ai_analysis.py --single
# Test stock scoring
python test_stock_scoring.py
The screener generates several output files:
selected_tickers_[date].json
: Basic information about all selected stocksinvestment_summary_[date].md
: Detailed investment summary with analysispenny_stocks_analysis_[date].md
: Comprehensive analysis of screened stocks
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
The stock screener uses Llama 3 via Ollama for generating stock analyses. This provides:
- Local processing of analyses (no API costs)
- Privacy (data stays on your machine)
- Customizable analysis through prompt engineering
- Fast response times
- Ollama installed and running
- Llama 3 model pulled (
ollama pull llama3:latest
) - Sufficient system resources for LLM inference