graphPaname/app/request_datasets.py

23 lines
407 B
Python
Raw Normal View History

2020-05-21 18:50:00 +02:00
from constants import datasets, url
2020-05-21 18:45:51 +02:00
from requests import get
from json import dump
def save_json(data):
with open("cycling-paths.json", "w") as f:
dump(data, f, ensure_ascii=False)
def request_dataset(url):
request = get(url)
2020-05-21 18:50:00 +02:00
data = request.json()
save_json(data)
2020-05-21 18:45:51 +02:00
def main():
2020-05-21 18:50:00 +02:00
url.format("deconfinement-pistes-cyclables-temporaires")
2020-05-21 18:45:51 +02:00
if __name__ == "__main__":
main()