Files
Brancheneinstufung2/refresh_references.py
Floke 7d4caa0833 feat(notion): Implement relational Competitive Radar import
- Added import_relational_radar.py for bidirectional database structure in Notion.
- Added refresh_references.py to populate analysis data with grounded facts via scraping.
- Updated documentation for Competitive Radar v2.0.
2026-01-11 11:57:43 +00:00

36 lines
1.0 KiB
Python

import asyncio
import json
import os
import sys
# Path to the orchestrator
sys.path.append(os.path.join(os.getcwd(), 'competitor-analysis-app'))
from competitor_analysis_orchestrator import analyze_single_competitor_references
async def refresh_references():
json_path = 'analysis_robo-planet.de.json'
with open(json_path, 'r') as f:
data = json.load(f)
competitors = data.get('competitors_shortlist', [])
if not competitors:
competitors = data.get('competitor_candidates', [])
print(f"Refreshing references for {len(competitors)} competitors...")
tasks = [analyze_single_competitor_references(c) for c in competitors]
results = await asyncio.gather(*tasks)
# Filter and update
data['reference_analysis'] = [r for r in results if r is not None]
with open(json_path, 'w') as f:
json.dump(data, f, indent=2)
print(f"Successfully updated {json_path} with grounded reference data.")
if __name__ == "__main__":
asyncio.run(refresh_references())