|
import streamlit as st
|
|
import pandas as pd
|
|
import sqlite3
|
|
from pathlib import Path
|
|
import sys
|
|
|
|
|
|
sys.path.append(str(Path(__file__).parent.parent))
|
|
|
|
|
|
st.set_page_config(
|
|
page_title="U18 Féminine - Stade Toulousain",
|
|
page_icon="./assets/Logo_Stade_Toulousain_Rugby.png",
|
|
layout="wide",
|
|
initial_sidebar_state="expanded"
|
|
)
|
|
|
|
|
|
from utils.styles import load_css, create_rugby_title
|
|
|
|
|
|
load_css()
|
|
|
|
|
|
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():
|
|
|
|
create_rugby_title("u18 féminine", "Stade Toulousain")
|
|
|
|
|
|
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"},
|
|
}
|
|
)
|
|
|
|
if selected == "Tableau de bord":
|
|
show_dashboard(df)
|
|
elif selected == "Analyse individuelle":
|
|
show_player_analysis(df)
|
|
elif selected == "Comparaison des joueuses":
|
|
show_players_comparison(df)
|
|
|
|
if __name__ == "__main__":
|
|
main() |