"""Seed the req-planner DB with neopixel-command-calculator requirements.""" import json import urllib.request API = "http://localhost:8100/api" def post(path, data): body = json.dumps(data).encode() req = urllib.request.Request(f"{API}/{path}", data=body, headers={ "Content-Type": "application/json", "Authorization": f"Bearer {TOKEN}", }) resp = urllib.request.urlopen(req) return json.loads(resp.read()) # Auth login = urllib.request.Request(f"{API}/auth/login", data=json.dumps({"password": "what_is_this_2"}).encode(), headers={"Content-Type": "application/json"}) TOKEN = json.loads(urllib.request.urlopen(login).read())["token"] # Project proj = post("projects", { "name": "neopixel-command-calculator", "description": "Engineering calculator for finding NeoPixel data transmission limits from single hardware sources. Web Components library (Lit + Vite) for CDN distribution.", "repo_url": "https://theres-a-git-in-this-tea.andrewawesomo.net/andrewadmin/neopixel-command-calculator", }) PID = proj["id"] print(f"Project {PID}: {proj['name']}") # Requirements data reqs = [ # Root pillar {"id": "NPC", "title": "NeoPixel Command Calculator", "description": "A Web Components library providing engineering calculators for NeoPixel/addressable LED data transmission limits. Ships as CDN-ready ES+UMD bundles via Lit + Vite.", "node_type": "pillar", "status": "draft", "priority": "critical", "project_id": PID, "acceptance_criteria": "- Library loadable via