Add constants file
This commit is contained in:
parent
531671d782
commit
626fc4bfd8
|
@ -0,0 +1,6 @@
|
||||||
|
datasets = [
|
||||||
|
"coronavirus-commercants-parisiens-livraison-a-domicile"
|
||||||
|
"deconfinement-pistes-cyclables-temporaires"
|
||||||
|
"deconfinement-paking-relais-doublement-des-places"
|
||||||
|
]
|
||||||
|
url = "https://opendata.paris.fr/api/v2/catalog/datasets/{}/exports/json?rows=-1&pretty=false&timezone=UTC"
|
|
@ -1,3 +1,4 @@
|
||||||
|
from constants import datasets, url
|
||||||
from requests import get
|
from requests import get
|
||||||
from json import dump
|
from json import dump
|
||||||
|
|
||||||
|
@ -9,14 +10,12 @@ def save_json(data):
|
||||||
|
|
||||||
def request_dataset(url):
|
def request_dataset(url):
|
||||||
request = get(url)
|
request = get(url)
|
||||||
response = request.json()
|
data = request.json()
|
||||||
response.dump()
|
save_json(data)
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
url = "https://opendata.paris.fr/api/v2/catalog/datasets/{}/exports/json?rows=-1&pretty=false&timezone=UTC".format(
|
url.format("deconfinement-pistes-cyclables-temporaires")
|
||||||
"deconfinement-pistes-cyclables-temporaires"
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
Loading…
Reference in New Issue