initial commit

This commit is contained in:
Thomas Bishop 2025-05-14 17:44:17 +01:00
commit a6ecac8db6
3 changed files with 41 additions and 0 deletions

2
.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
heartbeats.json

10
docker.sh Executable file
View file

@ -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

29
wakapi_import.py Normal file
View file

@ -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()