Files
Brancheneinstufung2/company-explorer/backend/scripts/notion_tools/debug_notion_schema.py
Floke d021b6b71c refactor: [30388f42] Strukturiere Root-Skripte thematisch neu
- Organisiert eine Vielzahl von Skripten aus dem Root-Verzeichnis in thematische Unterordner, um die Übersichtlichkeit zu verbessern und die Migration vorzubereiten.
- Verschiebt SuperOffice-bezogene Test- und Hilfsskripte in .
- Verschiebt Notion-bezogene Synchronisations- und Import-Skripte in .
- Archiviert eindeutig veraltete und ungenutzte Skripte in .
- Die zentralen Helfer  und  bleiben im Root, da sie von mehreren Tools als Abhängigkeit genutzt werden.
2026-03-06 10:16:08 +00:00

37 lines
924 B
Python

import requests
import json
# Notion Config
try:
with open("notion_token.txt", "r") as f:
NOTION_TOKEN = f.read().strip()
except FileNotFoundError:
print("Error: notion_token.txt not found.")
exit(1)
NOTION_VERSION = "2022-06-28"
NOTION_API_BASE_URL = "https://api.notion.com/v1"
HEADERS = {
"Authorization": f"Bearer {NOTION_TOKEN}",
"Notion-Version": NOTION_VERSION,
"Content-Type": "application/json",
}
# DB ID from import_product.py
DB_ID = "2e288f42-8544-8113-b878-ec99c8a02a6b"
def get_db_properties(database_id):
url = f"{NOTION_API_BASE_URL}/databases/{database_id}"
try:
response = requests.get(url, headers=HEADERS)
response.raise_for_status()
return response.json().get("properties")
except Exception as e:
print(f"Error: {e}")
return None
props = get_db_properties(DB_ID)
if props:
print(json.dumps(props, indent=2))