LaurentTRIPIED commited on
Commit
7923d70
1 Parent(s): b6be2f5

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 streamlit as st
2
- import pandas as pd
 
3
 
4
- def display_organisations_engagees(data):
5
- st.markdown("## OPEN DATA RSE")
6
- st.markdown("### Découvrez les organisations engagées RSE de la métropole de Bordeaux")
7
- num_etablissements = len(data)
8
-
9
- if num_etablissements > 0:
10
- st.markdown(f"Nombre d'établissements : {num_etablissements}")
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
- st.error("Données OPEN DATA RSE Bordeaux non disponibles actuellement. Veuillez vous reconnecter ultérieurement.")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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)