CoolFace
Apppublic

tlavandier/OpenData-Bordeaux-RSE

sourceHugging Facemitupdated 2y agoView on Hugging Face
1likes
AnalyseActionsRSE.py231 linesDownload Raw Back to root
1import streamlit as st2from ISO26000 import classify_actions_rse_ISO26000 as classify_iso260003from ODD import classify_actions_rse_ODD as classify_odd4from impactscore import classify_actions_rse_IMPACTSCORE as classify_impactscore5from data_manager import get_data6 7criteria = {}8if "Autres" not in criteria:9    criteria["Autres"] = []10 11company_info = "Some company info"12 13criteria["Autres"].append(company_info)14 15def display_analyse_actions_rse():16    st.markdown("## IA RSE :mag_right:")17    st.markdown("### Classification des actions RSE selon 3 approches :")18 19    approach = st.radio(20        "Choisissez l'approche de classification :point_down:",21        22        ["Norme ISO 26000", "ODD Objectifs de Développement Durable (en cours de développement)","Impact Score (en cours de développement)"],23        index=0,24        format_func=lambda x: x.split(" :")[0]25    )26 27    if approach == "Norme ISO 26000":28        # Récupérer les données depuis data_manager.py29        data, total_hits = get_data()30 31        st.markdown("""<hr style='border-color: darkgrey;'>""", unsafe_allow_html=True)32 33        st.markdown("""34                    :earth_africa: **QU'EST-CE QUE LA NORME ISO 26000 ?**35                    36                    La norme ISO 26000 propose une grille de lecture de la thématique développement durable ultra-pratique pour déployer une politique RSE d'entreprise bien structurée, qui ne laisse rien de côté. Publiée en 2010, cette norme volontaire a été élaborée en concertation avec près de 90 pays à travers le monde, dont la France.37                    38                    **COMMENT EST-ELLE STRUCTURÉE ?**39                    40                    ISO 26000 : Une grille de lecture à 7 entrées41                    42                    - 🏢 La gouvernance de la structure43                    - 👨‍👩‍👧‍👦 Les droits humains44                    - 🤝 Les conditions et relations de travail45                    - 🌱 La responsabilité environnementale46                    - ⚖️ La loyauté des pratiques47                    - 🛍️ Les questions relatives au consommateur et à la protection du consommateur48                    - 🌍 Les communautés et le développement local.49                """)50        st.markdown("""<small>Source AFNOR : <a href="https://www.afnor.org/developpement-durable/demarche-iso-26000/" target="_blank">www.afnor.org/developpement-durable/demarche-iso-26000/</a></small>""", unsafe_allow_html=True)51 52        st.markdown("""<hr style='border-color: darkgrey;'>""", unsafe_allow_html=True)53        st.markdown("### Classification des actions RSE selon ISO 26000")54 55        pictograms = {56            "Gouvernance de la structure": "🏢",57            "Droits humains": "👨‍👩‍👧‍👦",58            "Conditions et relations de travail": "🤝",59            "Responsabilité environnementale": "🌱",60            "Loyauté des pratiques": "⚖️",61            "Questions relatives au consommateur": "🛍️",62            "Communautés et développement local": "🌍",63            "Autres": "❓"64        }65 66        criteria_counts = classify_iso26000(data)67 68        total_actions = 069 70        for category, actions in criteria_counts.items():71            if category in pictograms:72                st.subheader(f"{pictograms[category]} {category}")73            else:74                st.subheader(f"{pictograms['Autres']} Autres")75            total_actions += len(actions)76            for action in actions:77                nom_entreprise = action.get('nom_courant_denomination', 'Information non disponible')78                st.write(f"Entreprise : {action.get('name','N/A')}, Action RSE : {action.get('action_rse', 'N/A')}, Activité : {action.get('activity', 'N/A')}, Ville : {action.get('city', 'N/A')}")79 80        st.markdown("""<hr style='border-color: darkgrey;'>""", unsafe_allow_html=True)81        st.markdown(f"**Total des actions RSE :** {total_actions}")82 83    elif approach == "Impact Score (en cours de développement)":84        # Récupérer les données depuis data_manager.py85        data, total_hits = get_data()86 87        st.markdown("""<hr style='border-color: darkgrey;'>""", unsafe_allow_html=True)88 89        st.markdown("""90                    🌳 **QU'EST-CE QUE L'IMPACT SCORE ?**91                    92                    Ce référentiel commun et unique a été co-construit par 30 réseaux d’entreprises afin de publier en transparence leurs données d’impact, exigence européenne depuis 2024.93                    94                    **COMMENT EST-IL STRUCTURÉE ?**95                    96                    IMPACT SCORE repose sur 3 piliers essentiels : 97                    98                    - 🚫 LIMITATION DES EXTERNALITÉS NÉGATIVES99                    - 💡 PARTAGE DU POUVOIR ET DE LA VALEUR100                    - 🎯 STRATÉGIE À IMPACT101                                    """)102        103     104        st.markdown("""<small>Source MOUVEMENT IMPACT FRANCE : <a href="https://impactscore.fr/comprendre-limpact-score/" target="_blank">https://impactscore.fr/comprendre-limpact-score/</a></small>""", unsafe_allow_html=True)105 106        st.markdown("""<hr style='border-color: darkgrey;'>""", unsafe_allow_html=True)107        108        pictograms = {109            "LIMITATION DES EXTERNALITÉS NÉGATIVES": "🚫",110            "PARTAGE DU POUVOIR ET DE LA VALEUR": "💡",111            "STRATÉGIE À IMPACT": "🎯",112            "Autres": "❓"113        }114 115        criteria_counts = classify_impactscore(data)116     117        total_actions = 0118 119        for category, actions in criteria_counts.items():120            if category in pictograms:121                st.subheader(f"{pictograms[category]} {category}")122            else:123                st.subheader(f"{pictograms['Autres']} Autres")124            total_actions += len(actions)125            for action in actions:126                nom_entreprise = action.get('nom_courant_denomination', 'Information non disponible')127                st.write(f"Entreprise : {action.get('name','N/A')}, Action RSE : {action.get('action_rse', 'N/A')}, Activité : {action.get('activity', 'N/A')}, Ville : {action.get('city', 'N/A')}")128 129        st.markdown("""<hr style='border-color: darkgrey;'>""", unsafe_allow_html=True)130        st.markdown(f"**Total des actions RSE :** {total_actions}")131 132   ### OBJECTIF DE DEVELOPPEMENT DURABLE ###133    elif approach == "ODD Objectifs de Développement Durable (en cours de développement)":134        # Récupérer les données depuis data_manager.py135        data, total_hits = get_data()136 137        st.markdown("""<hr style='border-color: darkgrey;'>""", unsafe_allow_html=True)138 139        st.markdown("""140                    🌳 **QU'EST-CE QUE LES 17 ODD ?**141                    142                    Au cœur de l’Agenda 2030, 17 Objectifs de développement durable (ODD) ont été fixés. Ils couvrent l’intégralité des enjeux de développement dans tous les pays tels que le climat, la biodiversité, l’énergie, l’eau, la pauvreté, l’égalité des genres, la prospérité économique ou encore la paix, l’agriculture, l’éducation, etc.143                    144                    **COMMENT SONT-ILS STRUCTURÉS ?**145                                                146                    - ODD n°1 - Pas de pauvreté147                    - ODD n°2 - Faim « Zéro »148                    - ODD n°3 - Bonne santé et bien-être149                    - ODD n°4 - Éducation de qualité150                    - ODD n°5 - Égalité entre les sexes151                    - ODD n°6 - Eau propre et assainissement152                    - ODD n°7 - Énergie propre et d'un coût abordable153                    - ODD n°8 - Travail décent et croissance économique154                    - ODD n°9 - Industrie, innovation et infrastructure155                    - ODD n°10 - Inégalités réduites156                    - ODD n°11 - Villes et communautés durable157                    - ODD n°12 - Consommation et production responsables158                    - ODD n°13 - Lutte contre les changements climatiques159                    - ODD n°14 - Vie aquatique160                    - ODD n°15 - Vie terrestre161                    - ODD n°16 - Paix, justice et institutions efficaces162                    - ODD n°17 - Partenariats pour la réalisation des objectifs163                    164                    """)165        166     167        st.markdown("""<small>Source AGENDA 2030 EN FRANCE : <a href="https://www.agenda-2030.fr/17-objectifs-de-developpement-durable/?" target="_blank">https://impactscore.fr/comprendre-limpact-score/</a></small>""", unsafe_allow_html=True)168 169        st.markdown("""<hr style='border-color: darkgrey;'>""", unsafe_allow_html=True)170        171        pictograms = {172            "Pas de pauvreté": "🌍",173            "Faim zéro": "🍽️",174            "Bonne santé et bien-être": "🏥",175            "Éducation de qualité": "📚",176            "Égalité entre les sexes": "⚖️",177            "Eau propre et assainissement": "🚰",178            "Énergie propre et d'un coût abordable": "💡",179            "Travail décent et croissance économique": "💼",180            "Industrie, innovation et infrastructure": "🏭",181            "Inégalités réduites": "🤝",182            "Villes et communautés durables": "🏘️",183            "Consommation et production responsables": "🛒",184            "Mesures relatives à la lutte contre les changements climatiques": "🌍",185            "Vie aquatique": "🐟",186            "Vie terrestre": "🌳",187            "Paix, justice et institutions efficaces": "⚖️",188            "Partenariats pour la réalisation des objectifs": "🤝",189            "Autres": "❓"190        }191        192        criteria_counts = classify_odd(data)193     194        total_actions = 0195 196        for category, actions in criteria_counts.items():197            if category in pictograms:198                st.subheader(f"{pictograms[category]} {category}")199            else:200                st.subheader(f"{pictograms['Autres']} Autres")201            total_actions += len(actions)202            for action in actions:203                nom_entreprise = action.get('nom_courant_denomination', 'Information non disponible')204                st.write(f"Entreprise : {action.get('name','N/A')}, Action RSE : {action.get('action_rse', 'N/A')}, Activité : {action.get('activity', 'N/A')}, Ville : {action.get('city', 'N/A')}")205 206        st.markdown("""<hr style='border-color: darkgrey;'>""", unsafe_allow_html=True)207        st.markdown(f"**Total des actions RSE :** {total_actions}")208 209    if approach == "Norme ISO 26000":210        st.subheader("Synthèse par catégorie ISO 26000")211        synthesis = {category: len(actions) for category, actions in criteria_counts.items()}212        synthesis_sorted = dict(sorted(synthesis.items(), key=lambda item: item[1], reverse=True))213        for category, count in synthesis_sorted.items():214            st.write(f"{category}: {count} action(s) RSE")215    216    elif approach == "ODD Objectifs de Développement Durable (en cours de développement)":217        st.subheader("Synthèse par catégorie ODD")218        synthesis = {category: len(actions) for category, actions in criteria_counts.items()}219        synthesis_sorted = dict(sorted(synthesis.items(), key=lambda item: item[1], reverse=True))220        for category, count in synthesis_sorted.items():221            st.write(f"{category}: {count} action(s) RSE")222            223    elif approach == "Impact Score (en cours de développement)":224        st.subheader("Synthèse par catégorie Impact Score")225        synthesis = {category: len(actions) for category, actions in criteria_counts.items()}226        synthesis_sorted = dict(sorted(synthesis.items(), key=lambda item: item[1], reverse=True))227        for category, count in synthesis_sorted.items():228            st.write(f"{category}: {count} action(s) RSE") 229 230if __name__ == "__main__":231    display_analyse_actions_rse()