This commit is contained in:
Alexander Munch-Hansen 2019-04-07 00:01:06 +02:00
parent 4634409738
commit 65a49dfb95
3 changed files with 3 additions and 3 deletions

View file

@ -10,7 +10,7 @@ from typing import List
import requests_cache import requests_cache
from flask import Flask, jsonify, logging, request from flask import Flask, jsonify, logging, request
from .strategies import miloStrats, iss, cars_in_traffic, tide_strat, upstairs_neighbour, bing, battery from .strategies import miloStrats, iss, cars_in_traffic, tide_strat, upstairs_neighbour, bing, svm_strat, battery
from .util import Context from .util import Context
app = Flask(__name__) app = Flask(__name__)
@ -30,6 +30,7 @@ strategies = {
"tide": tide_strat.is_tide, "tide": tide_strat.is_tide,
"upstairs_neighbour": upstairs_neighbour.check_games, "upstairs_neighbour": upstairs_neighbour.check_games,
"bing": bing.clock, "bing": bing.clock,
"svm_parking": svm_strat.perform_svm_pred,
"battery_level": battery.battery_level, "battery_level": battery.battery_level,
} }

View file

@ -0,0 +1 @@
{"help": "https://portal.opendata.dk/api/3/action/help_show?name=datastore_search", "success": true, "result": {"include_total": true, "resource_id": "2a82a145-0195-4081-a13c-b0e587e9b89c", "fields": [{"type": "int", "id": "_id"}, {"type": "text", "id": "date"}, {"type": "text", "id": "garageCode"}, {"type": "int4", "id": "totalSpaces"}, {"type": "int4", "id": "vehicleCount"}], "records_format": "objects", "records": [{"_id": 1, "date": "2019/04/06 22:30:01", "garageCode": "NORREPORT", "totalSpaces": 80, "vehicleCount": 61}, {"_id": 2, "date": "2019/04/06 22:30:01", "garageCode": "SCANDCENTER", "totalSpaces": 1240, "vehicleCount": 442}, {"_id": 6, "date": "2019/04/06 22:30:01", "garageCode": "SALLING", "totalSpaces": 700, "vehicleCount": 290}, {"_id": 7, "date": "2019/04/06 22:30:01", "garageCode": "DOKK1", "totalSpaces": 1000, "vehicleCount": 0}, {"_id": 8, "date": "2019/04/06 22:30:01", "garageCode": "Navitas", "totalSpaces": 449, "vehicleCount": 161}, {"_id": 9, "date": "2019/04/06 22:30:01", "garageCode": "NewBusgadehuset", "totalSpaces": 105, "vehicleCount": 99}, {"_id": 3, "date": "2019/04/06 22:30:01", "garageCode": "BRUUNS", "totalSpaces": 953, "vehicleCount": 598}, {"_id": 4, "date": "2019/04/06 22:30:01", "garageCode": "MAGASIN", "totalSpaces": 378, "vehicleCount": 65}, {"_id": 5, "date": "2019/04/06 22:30:01", "garageCode": "KALKVAERKSVEJ", "totalSpaces": 210, "vehicleCount": 278}, {"_id": 10, "date": "2019/04/06 22:30:01", "garageCode": "Urban Level 1", "totalSpaces": 319, "vehicleCount": 32}, {"_id": 11, "date": "2019/04/06 22:30:01", "garageCode": "Urban Level 2+3", "totalSpaces": 654, "vehicleCount": 66}], "_links": {"start": "/api/3/action/datastore_search?resource_id=2a82a145-0195-4081-a13c-b0e587e9b89c", "next": "/api/3/action/datastore_search?offset=100&resource_id=2a82a145-0195-4081-a13c-b0e587e9b89c"}, "total": 11}}

View file

@ -5,11 +5,9 @@ import glob
import json import json
import numpy as np import numpy as np
from .strat_utils import write_json from .strat_utils import write_json
from ..util import Context, Prediction from ..util import Context, Prediction
def write_data(time): def write_data(time):
write_json("https://portal.opendata.dk/api/3/action/datastore_search?resource_id=2a82a145-0195-4081-a13c-b0e587e9b89c", "parking_aarhus", time) write_json("https://portal.opendata.dk/api/3/action/datastore_search?resource_id=2a82a145-0195-4081-a13c-b0e587e9b89c", "parking_aarhus", time)