import streamlit as st import pandas as pd import sys import os import plotly.graph_objects as go from plotly.subplots import make_subplots import numpy as np # Import du module d'analyse sys.path.append(os.path.join(os.path.dirname(__file__), '..')) from Analytics.VortexOutFlux import VortexOutFlux from Analytics.DataSyncForecasting import actualiser_forecasting_depuis_prets # === CSS AMÉLIORÉ - STYLE GOTHAM PROFESSIONNEL === def apply_forecasting_styles(): st.markdown(""" """, unsafe_allow_html=True) def render_forecast_card(month_data): """Génère une carte de prédiction mensuelle style Gotham""" date_str = month_data['Date'].strftime("%B %Y") montant = month_data['Montant_Predit'] lower = month_data['Borne_Inf'] upper = month_data['Borne_Sup'] # Calcul de la marge d'erreur margin = ((upper - lower) / 2) / montant * 100 if montant > 0 else 0 html = f"""
Synchronisation automatique : Les données de flux de sortie sont calculées automatiquement depuis les déblocages de prêts (Prets_Master). Cliquez sur le bouton pour actualiser.
Tendance : {interpretations['message_principal']}
Fiabilité : {interpretations['message_fiabilite']}
Précision : {interpretations['message_precision']}