Skip to content

Commit

Permalink
Write to a Jekyll data store path instead
Browse files Browse the repository at this point in the history
  • Loading branch information
JackGilmore committed Mar 16, 2024
1 parent 3675de4 commit 5bb32d7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
File renamed without changes.
6 changes: 5 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import requests
import json
import csv
import os

BASE_URL = "https://integration.aberdeencity.gov.uk"
MAP_INTEGRATION_URL = BASE_URL + "/apibroker/runLookup?id=5ba25e5ed7042"
OUTPUT_PATH = "_data/roads.csv"

payload = json.dumps(
{
Expand Down Expand Up @@ -128,7 +130,9 @@
"Last updated",
]

with open("roads.csv", "w", newline="") as f:
os.makedirs(os.path.dirname(OUTPUT_PATH), exist_ok=True)

with open(OUTPUT_PATH, "w", newline="") as f:
csv_writer = csv.writer(f)

csv_writer.writerow(header)
Expand Down

0 comments on commit 5bb32d7

Please sign in to comment.