From bbcae0e02b776b3b7bdb0270fb5af0b58d1c9320 Mon Sep 17 00:00:00 2001 From: Robbe Van Herck Date: Wed, 13 May 2020 17:16:21 +0200 Subject: [PATCH] add conversion script --- blokmap_to_sheet.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 blokmap_to_sheet.py diff --git a/blokmap_to_sheet.py b/blokmap_to_sheet.py new file mode 100755 index 0000000..254a791 --- /dev/null +++ b/blokmap_to_sheet.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python + +import requests + +response = requests.get("https://blok.ugent.be/data.json") +data = response.json() + +for location in data: + print("\t".join([ + str(location["geometry"]["coordinates"][1]), + str(location["geometry"]["coordinates"][0]), + str(location["properties"]["name"]), + str(location["properties"]["address"]), + str(location["properties"]["capacity"]), + str(location["properties"]["period"]["start"]), + str(location["properties"]["period"]["end"]), + str(location["properties"]["hours"]["monday"]), + str(location["properties"]["hours"]["tuesday"]), + str(location["properties"]["hours"]["wednesday"]), + str(location["properties"]["hours"]["thursday"]), + str(location["properties"]["hours"]["friday"]), + str(location["properties"]["hours"]["saturday"]), + str(location["properties"]["hours"]["sunday"]), + str(location["properties"]["extra"]), + str(location["properties"]["type"]) + ]))