ruff format
This commit is contained in:
parent
37e3e8ad6f
commit
d777558b34
17 changed files with 411 additions and 368 deletions
|
|
@ -1,16 +1,16 @@
|
|||
import requests
|
||||
|
||||
API_KEY = 'AIzaSyBoBHzeQFgR7O-NlNsuHXQcC1B7ccEHpl8'
|
||||
API_KEY = "AIzaSyBoBHzeQFgR7O-NlNsuHXQcC1B7ccEHpl8"
|
||||
url = "https://maps.googleapis.com/maps/api/distancematrix/json"
|
||||
origin = '51.5636306598907,-0.11061106079085892'
|
||||
origin = "51.5636306598907,-0.11061106079085892"
|
||||
dest = "51.53836609846008,-0.12743940233824352"
|
||||
|
||||
params = {
|
||||
"origins": origin,
|
||||
"destinations": dest,
|
||||
"key": API_KEY,
|
||||
"departure_time": "", # timstamp, optional
|
||||
"mode": "transit",
|
||||
"origins": origin,
|
||||
"destinations": dest,
|
||||
"key": API_KEY,
|
||||
"departure_time": "", # timstamp, optional
|
||||
"mode": "transit",
|
||||
}
|
||||
|
||||
r = requests.get(url, params=params)
|
||||
|
|
@ -18,6 +18,5 @@ print(r.status_code)
|
|||
|
||||
print(r.json())
|
||||
|
||||
with open('code/json/routing_distancematrix.json', 'w') as f:
|
||||
f.write(r.text)
|
||||
|
||||
with open("code/json/routing_distancematrix.json", "w") as f:
|
||||
f.write(r.text)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue