Spaces:
Runtime error
Runtime error
# data_manager.py | |
import requests | |
def get_data(): | |
url = "https://opendata.bordeaux-metropole.fr/api/records/1.0/search/?dataset=met_etablissement_rse&q=&rows=100" | |
response = requests.get(url) | |
if response.status_code == 200: | |
data = response.json() | |
records = data.get("records", []) | |
return [record["fields"] for record in records], data.get("nhits", 0) | |
else: | |
return [], 0 | |