Utilisation des stats produites par decp_processing

This commit is contained in:
Colin Maudry
2026-01-14 18:16:50 +01:00
parent d8dcb04fbf
commit 3c68317f9d
3 changed files with 56 additions and 2 deletions
+21
View File
@@ -5,6 +5,8 @@ import plotly.express as px
import polars as pl
from dash import dash_table, dcc, html
from src.utils import format_number
def get_map_count_marches(df: pl.DataFrame):
lf = df.lazy()
@@ -56,6 +58,25 @@ def get_map_count_marches(df: pl.DataFrame):
return fig
def get_yearly_statistics(statistics, today_str) -> html.Div:
children = []
for year in reversed(range(2018, int(today_str.split("/")[-1]) + 1)):
year = str(year)
stat_year = statistics[year]
md = dcc.Markdown(f"""
#### {year}
- Nombre de marchés publics et accords-cadres : {format_number(stat_year["nb_notifications_marches"])}
- Nombre d'acheteurs publics : {format_number(stat_year["nb_acheteurs_uniques"])}
- Nombre de titulaires : {format_number(stat_year["nb_titulaires_uniques"])}
""")
children.append(md)
return html.Div(children=children)
def get_barchart_sources(df: pl.DataFrame, type_date: str):
lf = df.lazy()
labels = {