import streamlit as st import pandas as pd import sqlite3 from pathlib import Path import sys # Ajouter le répertoire parent au path pour les imports sys.path.append(str(Path(__file__).parent.parent)) # Configuration de la page st.set_page_config( page_title="U18 Féminines - Stade Toulousain", page_icon="./assets/Logo_Stade_Toulousain_Rugby.png", layout="wide", initial_sidebar_state="expanded" ) # Charger les styles personnalisés from utils.styles import load_css, create_rugby_title # CHARGER LES STYLES CSS load_css() # Imports des composants from components.dashboard import show_dashboard from components.player_analysis import show_player_analysis from components.players_comparison import show_players_comparison from utils.data_loader import load_data def main(): # Titre principal create_rugby_title("u18 féminines", "Stade Toulousain") # Charger les données try: df = load_data() except Exception as e: st.error(f"Erreur lors du chargement des données : {e}") st.stop() from streamlit_option_menu import option_menu with st.sidebar: selected = option_menu( None, ["Tableau de bord", 'Analyse individuelle', 'Comparaison des joueuses'], icons=None, default_index=1, menu_icon="cast", styles={ "container": {"padding": "0!important", "background-color": "#fafafa"}, "icon": {"display": "None"}, "nav-link": {"font-size": "16px", "text-align": "left", "margin":"3px", "--hover-color": "#eee"}, "nav-link-selected": {"background-color": "#000000"}, } ) # Affichage des pages if selected == "Tableau de bord": show_dashboard(df) elif selected == "Analyse individuelle": show_player_analysis(df) elif selected == "Comparaison joueuses": show_players_comparison(df) if __name__ == "__main__": main()