commit a6ecac8db6d0d1527636a66cc802594ea24d4957 Author: thomasabishop Date: Wed May 14 17:44:17 2025 +0100 initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4478b29 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +heartbeats.json + diff --git a/docker.sh b/docker.sh new file mode 100755 index 0000000..62d9b0c --- /dev/null +++ b/docker.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +docker run -d \ + --name wakapi \ + -p 3000:3000 \ + -e "WAKAPI_PORT=3000" \ + -e "WAKAPI_DB_TYPE=sqlite3" \ + -e "WAKAPI_DB_PATH=/app/data/wakapi.db" \ + -v wakapi-data:/app/data \ + n1try/wakapi diff --git a/wakapi_import.py b/wakapi_import.py new file mode 100644 index 0000000..cfb0c9d --- /dev/null +++ b/wakapi_import.py @@ -0,0 +1,29 @@ +import json + +# def parse_individual_heartbeat(heartbeat): +# processed_heartbeat = { +# "id": heartbeat.get("id", ""), +# "branch": heartbeat.get("branch", null), +# } + + +f = open("heartbeats.json") +data = json.load(f) + +days = data["days"] +first_day = days[0]["heartbeats"] +sample_heartbeat = days[0]["heartbeats"][0] +formatted = json.dumps(sample_heartbeat, indent=4) + +test_batch = first_day[:10] +dead_letter = [] +print(len(test_batch)) + + +# for hb in first_day: + + +print(formatted) + + +f.close()