Commit
·
5e1d6fd
1
Parent(s):
4c61496
Pytorch V0.23
Browse files
__pycache__/organisations_engagees.cpython-312.pyc
CHANGED
|
Binary files a/__pycache__/organisations_engagees.cpython-312.pyc and b/__pycache__/organisations_engagees.cpython-312.pyc differ
|
|
|
organisations_engagees.py
CHANGED
|
@@ -1,20 +1,28 @@
|
|
| 1 |
-
import
|
| 2 |
-
import
|
|
|
|
| 3 |
|
| 4 |
-
def
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
df = pd.DataFrame(data)
|
| 12 |
-
st.dataframe(df[['nom_courant_denomination', 'commune', 'libelle_section_naf', 'tranche_effectif_entreprise', 'action_rse']].rename(columns={
|
| 13 |
-
'nom_courant_denomination': 'Nom',
|
| 14 |
-
'commune': 'Commune',
|
| 15 |
-
'libelle_section_naf': 'Section NAF',
|
| 16 |
-
'tranche_effectif_entreprise': 'Effectif',
|
| 17 |
-
'action_rse': 'Action RSE'
|
| 18 |
-
}))
|
| 19 |
else:
|
| 20 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import requests
|
| 2 |
+
import folium
|
| 3 |
+
from streamlit_folium import folium_static
|
| 4 |
|
| 5 |
+
def get_data():
|
| 6 |
+
url = "https://opendata.bordeaux-metropole.fr/api/records/1.0/search/?dataset=met_etablissement_rse&q=&rows=100"
|
| 7 |
+
response = requests.get(url)
|
| 8 |
+
if response.status_code == 200:
|
| 9 |
+
data = response.json()
|
| 10 |
+
records = data.get("records", [])
|
| 11 |
+
return [record.get("fields") for record in records]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
else:
|
| 13 |
+
return []
|
| 14 |
+
|
| 15 |
+
def display_map(data):
|
| 16 |
+
m = folium.Map(location=[44.837789, -0.57918], zoom_start=12)
|
| 17 |
+
for item in data:
|
| 18 |
+
point_geo = item.get('point_geo')
|
| 19 |
+
if isinstance(point_geo, dict):
|
| 20 |
+
lon = point_geo.get('lon')
|
| 21 |
+
lat = point_geo.get('lat')
|
| 22 |
+
if lon and lat:
|
| 23 |
+
folium.Marker(
|
| 24 |
+
[lat, lon],
|
| 25 |
+
icon=folium.Icon(color="green", icon="leaf"),
|
| 26 |
+
popup=item.get('nom_courant_denomination', 'Information non disponible'),
|
| 27 |
+
).add_to(m)
|
| 28 |
+
folium_static(m)
|