AI-powered restaurant review analysis engine using Claude Sonnet 4 with prompt caching.
- 🤖 Claude Sonnet 4 analysis with 90% cost reduction via prompt caching
- 🌍 Google Maps review scraping via Outscraper
- 📊 Excel export with multiple sheets (Scores + Keywords)
- 🔄 Resumable analysis with local caching
- ⚡ Parallel processing (configurable workers)
- 💰 Real-time cost tracking
pip install -r requirements.txtcp .env.example .env
# Edit .env with your API keysFrom CSV:
python cli/main.py analyze --input data/input/reviews.csv --output data/output/From Google Maps:
python cli/main.py scrape --name "McDonald's Paris Nord" --location "Paris, France" --max-reviews 2000With competitors:
python cli/main.py scrape --name "McDonald's Paris Nord" \
--competitors "Burger King Paris" "KFC Paris" \
--location "Paris, France" \
--max-reviews 2000Edit config/settings.py or set environment variables:
ANTHROPIC_API_KEY=sk-ant-...
OUTSCRAPER_API_KEY=...
MAX_WORKERS=10
MAX_TOKENS=1000python cli/main.py estimate --reviews 2000Output:
Estimated costs for 2,000 reviews:
Outscraper: $3.00
Claude API: $8.00 (with caching)
Total: $11.00
src/analyzers/- AI analysis logicsrc/scrapers/- Data collection (Outscraper, CSV)src/processors/- Orchestration & cachingsrc/exporters/- Excel/JSON exportcli/- Command-line interfacetests/- Unit tests
from src.scrapers.outscraper_scraper import OutscraperScraper
from src.analyzers.anthropic_analyzer import AnthropicAnalyzer
from src.processors.orchestrator import Orchestrator
from src.exporters.excel_exporter import ExcelExporter
# 1. Scrape reviews
scraper = OutscraperScraper(api_key="...")
reviews = scraper.scrape("McDonald's Paris", max_reviews=2000)
# 2. Analyze
analyzer = AnthropicAnalyzer(api_key="...")
orchestrator = Orchestrator(analyzer)
results = orchestrator.analyze(reviews, max_workers=10)
# 3. Export
ExcelExporter.export(results, "output.xlsx")Run tests:
pytest tests/Run with mock analyzer (no API calls):
python cli/main.py analyze --input data/input/reviews.csv --mockMIT