feat: Enhanced CE schema and Notion sync (Pains/Gains)
This commit is contained in:
27
scripts/discover_notion_dbs.py
Normal file
27
scripts/discover_notion_dbs.py
Normal file
@@ -0,0 +1,27 @@
|
||||
import os
|
||||
import requests
|
||||
import json
|
||||
from dotenv import load_dotenv
|
||||
|
||||
load_dotenv(dotenv_path="/home/node/clawd/.env")
|
||||
|
||||
def discover_dbs():
|
||||
token = os.getenv("NOTION_API_KEY")
|
||||
headers = {
|
||||
"Authorization": f"Bearer {token}",
|
||||
"Content-Type": "application/json",
|
||||
"Notion-Version": "2022-06-28"
|
||||
}
|
||||
url = "https://api.notion.com/v1/search"
|
||||
payload = {"filter": {"value": "database", "property": "object"}}
|
||||
|
||||
resp = requests.post(url, headers=headers, json=payload)
|
||||
results = resp.json().get("results", [])
|
||||
|
||||
print("--- Gefundene Datenbanken ---")
|
||||
for db in results:
|
||||
title = db.get("title", [{}])[0].get("plain_text", "Unbekannt")
|
||||
print(f"Name: {title} | ID: {db['id']}")
|
||||
|
||||
if __name__ == "__main__":
|
||||
discover_dbs()
|
||||
Reference in New Issue
Block a user