feat(company-explorer): add wikipedia integration, robotics settings, and manual overrides
- Ported robust Wikipedia extraction logic (categories, first paragraph) from legacy system. - Implemented database-driven Robotics Category configuration with frontend settings UI. - Updated Robotics Potential analysis to use Chain-of-Thought infrastructure reasoning. - Added Manual Override features for Wikipedia URL (with locking) and Website URL (with re-scrape trigger). - Enhanced Inspector UI with Wikipedia profile, category tags, and action buttons.
This commit is contained in:
@@ -1,39 +1,42 @@
|
||||
import time
|
||||
import json
|
||||
from notion_client import Client
|
||||
|
||||
def final_push():
|
||||
# --- KONFIGURATION DIREKT IN DER FUNKTION ---
|
||||
token = "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"
|
||||
database_id = "acf0e7e1-fff2-425b-81a1-00fbc76085b8"
|
||||
# SETUP
|
||||
TOKEN = "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"
|
||||
SECTOR_DB_ID = "59a4598a20084ddaa035f5eba750a1be"
|
||||
|
||||
notion = Client(auth=TOKEN)
|
||||
|
||||
def inspect_via_page():
|
||||
print(f"🔍 Suche nach einer Seite in DB {SECTOR_DB_ID}...")
|
||||
|
||||
notion = Client(auth=token)
|
||||
|
||||
print(f"🚀 Starte Injektion in DB: {database_id}")
|
||||
try:
|
||||
# 1. Wir holen uns die erste verfügbare Seite aus der Datenbank
|
||||
response = notion.databases.query(
|
||||
database_id=SECTOR_DB_ID,
|
||||
page_size=1
|
||||
)
|
||||
|
||||
results = response.get("results")
|
||||
if not results:
|
||||
print("⚠️ Keine Seiten in der Datenbank gefunden. Bitte lege manuell eine an.")
|
||||
return
|
||||
|
||||
sectors = [
|
||||
{"name": "Hotellerie", "desc": "Relevant für Empfang, Reinigung Zimmer, Parkplatz & Spa. Fokus auf Wellness vs. Business."},
|
||||
{"name": "Pflege & Kliniken", "desc": "Hohe Hygienestandards, Desinfektion, Transport von Mahlzeiten/Wäsche."},
|
||||
{"name": "Lager & Produktion", "desc": "Großflächenreinigung, Objektschutz (Security), Intralogistik-Transport."},
|
||||
{"name": "Einzelhandel", "desc": "Frequenzorientierte Reinigung, interaktive Verkaufsförderung (Ads), Nachtreinigung."}
|
||||
]
|
||||
page = results[0]
|
||||
print(f"✅ Seite gefunden: '{page['id']}'")
|
||||
|
||||
# 2. Wir inspizieren die Properties der Seite
|
||||
properties = page.get("properties", {})
|
||||
|
||||
print("\n--- INTERNE PROPERTY-MAP DER SEITE ---")
|
||||
print(json.dumps(properties, indent=2))
|
||||
|
||||
print("\n--- ZUSAMMENFASSUNG FÜR DEINE PIPELINE ---")
|
||||
for prop_name, prop_data in properties.items():
|
||||
print(f"Spaltenname: '{prop_name}' | ID: {prop_data.get('id')} | Typ: {prop_data.get('type')}")
|
||||
|
||||
for s in sectors:
|
||||
try:
|
||||
notion.pages.create(
|
||||
parent={"database_id": database_id},
|
||||
properties={
|
||||
"Name": {"title": [{"text": {"content": s["name"]}}]},
|
||||
"Beschreibung": {"rich_text": [{"text": {"content": s["desc"]}}]},
|
||||
"Art": {"select": {"name": "Sector"}}
|
||||
}
|
||||
)
|
||||
print(f" ✅ {s['name']} wurde erfolgreich angelegt.")
|
||||
time.sleep(0.5)
|
||||
|
||||
except Exception as e:
|
||||
print(f" ❌ Fehler bei {s['name']}: {e}")
|
||||
|
||||
print("\n🏁 FERTIG. Schau jetzt in dein Notion Dashboard!")
|
||||
except Exception as e:
|
||||
print(f"💥 Fehler beim Inspect: {e}")
|
||||
|
||||
if __name__ == "__main__":
|
||||
final_push()
|
||||
inspect_via_page()
|
||||
Reference in New Issue
Block a user