feat: Documentation and Tool Config Update
This commit is contained in:
70
scripts/update_notion_tasks_status.py
Normal file
70
scripts/update_notion_tasks_status.py
Normal file
@@ -0,0 +1,70 @@
|
||||
import os
|
||||
import requests
|
||||
import json
|
||||
from dotenv import load_dotenv
|
||||
|
||||
load_dotenv(dotenv_path="/home/node/clawd/.env")
|
||||
|
||||
NOTION_TOKEN = os.getenv("NOTION_API_KEY")
|
||||
HEADERS = {
|
||||
"Authorization": f"Bearer {NOTION_TOKEN}",
|
||||
"Content-Type": "application/json",
|
||||
"Notion-Version": "2022-06-28"
|
||||
}
|
||||
|
||||
# IDs from previous fetch
|
||||
TASKS = {
|
||||
"Setup GCP": "2ea88f42-8544-8073-b287-eb83ce581c0b",
|
||||
"SO API POC": "2ff88f42-8544-8093-a301-fc27b3886aa1",
|
||||
"Pains Gains Vertical": "2ff88f42-8544-8050-8245-c3bb852058f4",
|
||||
"Segmentierung Bestand": "2ff88f42-8544-808f-862b-c30ab2f29783",
|
||||
"Matrixmultiplikation": "2ff88f42-8544-8079-a23e-c248e35b09a0"
|
||||
}
|
||||
|
||||
TASKS_DB_ID = "30588f42-8544-80c3-8919-e22d74d945ea" # From discovery
|
||||
PROJECT_ID = "2ea88f42-8544-8074-9ad8-c24d283bc1c9"
|
||||
|
||||
def update_status(page_id, status):
|
||||
url = f"https://api.notion.com/v1/pages/{page_id}"
|
||||
payload = {"properties": {"Status": {"status": {"name": status}}}}
|
||||
requests.patch(url, headers=HEADERS, json=payload)
|
||||
print(f"Updated Status {page_id} -> {status}")
|
||||
|
||||
def add_comment(page_id, text):
|
||||
url = "https://api.notion.com/v1/comments"
|
||||
payload = {
|
||||
"parent": {"page_id": page_id},
|
||||
"rich_text": [{"text": {"content": text}}]
|
||||
}
|
||||
requests.post(url, headers=HEADERS, json=payload)
|
||||
print(f"Added comment to {page_id}")
|
||||
|
||||
def create_task(title):
|
||||
url = "https://api.notion.com/v1/pages"
|
||||
payload = {
|
||||
"parent": {"database_id": TASKS_DB_ID},
|
||||
"properties": {
|
||||
"Name": {"title": [{"text": {"content": title}}]},
|
||||
"Status": {"status": {"name": "To Do"}},
|
||||
"Project": {"relation": [{"id": PROJECT_ID}]}
|
||||
}
|
||||
}
|
||||
requests.post(url, headers=HEADERS, json=payload)
|
||||
print(f"Created Task: {title}")
|
||||
|
||||
def run():
|
||||
# 1. Done
|
||||
update_status(TASKS["Setup GCP"], "Done")
|
||||
update_status(TASKS["SO API POC"], "Done")
|
||||
|
||||
# 2. Progress Comments
|
||||
add_comment(TASKS["Pains Gains Vertical"], "✅ Entwurf in Notion finalisiert und detailliert (inkl. Hygiene-Fokus). Bereit für Review am Freitag.")
|
||||
add_comment(TASKS["Segmentierung Bestand"], "✅ Company Explorer Schema erweitert (V2). Bereit für Excel-Import.")
|
||||
add_comment(TASKS["Matrixmultiplikation"], "✅ Logik '3+1' (Prio Produkt + Sekundär bei Ops-Rolle) in Datenstruktur abgebildet.")
|
||||
|
||||
# 3. New Tasks
|
||||
create_task("Company Explorer: Daten-Sync & CRM-Import")
|
||||
create_task("SuperOffice: Definition & Anlage UDF-Felder (Intro-Text)")
|
||||
|
||||
if __name__ == "__main__":
|
||||
run()
|
||||
Reference in New Issue
Block a user