Spaces:
Runtime error
Runtime error
LaurentTRIPIED
commited on
Commit
•
3c1cd3f
1
Parent(s):
e0da0be
Pytorch v.48
Browse files- data_manager.py +12 -0
- localisation.py +1 -0
- organisations_engagees.py +1 -0
data_manager.py
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# data_manager.py
|
2 |
+
import requests
|
3 |
+
|
4 |
+
def get_data():
|
5 |
+
url = "https://opendata.bordeaux-metropole.fr/api/records/1.0/search/?dataset=met_etablissement_rse&q=&rows=100"
|
6 |
+
response = requests.get(url)
|
7 |
+
if response.status_code == 200:
|
8 |
+
data = response.json()
|
9 |
+
records = data.get("records", [])
|
10 |
+
return [record["fields"] for record in records], data.get("nhits", 0)
|
11 |
+
else:
|
12 |
+
return [], 0
|
localisation.py
CHANGED
@@ -2,6 +2,7 @@ import requests
|
|
2 |
import folium
|
3 |
from streamlit_folium import folium_static
|
4 |
import streamlit as st
|
|
|
5 |
|
6 |
def display_map():
|
7 |
data, _ = get_data()
|
|
|
2 |
import folium
|
3 |
from streamlit_folium import folium_static
|
4 |
import streamlit as st
|
5 |
+
from data_manager import get_data
|
6 |
|
7 |
def display_map():
|
8 |
data, _ = get_data()
|
organisations_engagees.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
|
2 |
import streamlit as st
|
3 |
import pandas as pd
|
|
|
4 |
|
5 |
# Fonction pour l'onglet "Organisations engagées"
|
6 |
def display_organisations_engagees():
|
|
|
1 |
|
2 |
import streamlit as st
|
3 |
import pandas as pd
|
4 |
+
from data_manager import get_data
|
5 |
|
6 |
# Fonction pour l'onglet "Organisations engagées"
|
7 |
def display_organisations_engagees():
|