SPARC/main.py
0xWheatyz a498b6f525 docs: update documentation for OpenRouter migration
Update all user-facing documentation to reflect the migration from
Anthropic API to OpenRouter.

Changes:
- Update README.md to reference OpenRouter instead of Anthropic in:
  - Features section
  - Architecture diagram comments
  - Configuration instructions
  - API key acquisition links
- Update main.py docstring to use OPENROUTER_API_KEY

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-02-22 12:27:06 -05:00

44 lines
1.0 KiB
Python

"""SPARC - Semiconductor Patent & Analytics Report Core
Example usage of the company performance analyzer.
Before running:
1. Create a .env file with:
API_KEY=your_serpapi_key
OPENROUTER_API_KEY=your_openrouter_key
2. Run: python main.py
"""
from SPARC.analyzer import CompanyAnalyzer
def main():
"""Analyze a company's performance based on their patent portfolio."""
# Initialize the analyzer (loads API keys from .env)
analyzer = CompanyAnalyzer()
# Analyze a company - this will:
# 1. Retrieve patents from SERP API
# 2. Download and parse patent PDFs
# 3. Minimize content (remove bloat)
# 4. Analyze with Claude to estimate performance
company_name = "nvidia"
print(f"\n{'=' * 70}")
print(f"SPARC Patent Analysis - {company_name.upper()}")
print(f"{'=' * 70}\n")
analysis = analyzer.analyze_company(company_name)
print(f"\n{'=' * 70}")
print("ANALYSIS RESULTS")
print(f"{'=' * 70}\n")
print(analysis)
print(f"\n{'=' * 70}\n")
if __name__ == "__main__":
main()