Implement dataset request draft
This commit is contained in:
parent
3ec2ad16b7
commit
531671d782
|
@ -1 +1,2 @@
|
||||||
app/__pycache__
|
app/__pycache__
|
||||||
|
Design.org
|
||||||
|
|
|
@ -1,16 +0,0 @@
|
||||||
from requests import get
|
|
||||||
|
|
||||||
|
|
||||||
def dummy_request(url):
|
|
||||||
request = get(url)
|
|
||||||
print(request.text)
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
|
||||||
dummy_request(
|
|
||||||
"https://opendata.paris.fr/api/records/1.0/search/?dataset=velib-disponibilite-en-temps-reel&q=&facet=name&facet=is_installed&facet=is_renting&facet=is_returning&facet=nom_arrondissement_communes"
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
main()
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
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)
|
||||||
|
response = request.json()
|
||||||
|
response.dump()
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
url = "https://opendata.paris.fr/api/v2/catalog/datasets/{}/exports/json?rows=-1&pretty=false&timezone=UTC".format(
|
||||||
|
"deconfinement-pistes-cyclables-temporaires"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
Loading…
Reference in New Issue