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 json import dump
|
||||
|
||||
|
@ -9,14 +10,12 @@ def save_json(data):
|
|||
|
||||
def request_dataset(url):
|
||||
request = get(url)
|
||||
response = request.json()
|
||||
response.dump()
|
||||
data = request.json()
|
||||
save_json(data)
|
||||
|
||||
|
||||
def main():
|
||||
url = "https://opendata.paris.fr/api/v2/catalog/datasets/{}/exports/json?rows=-1&pretty=false&timezone=UTC".format(
|
||||
"deconfinement-pistes-cyclables-temporaires"
|
||||
)
|
||||
url.format("deconfinement-pistes-cyclables-temporaires")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
Loading…
Reference in New Issue