Ajout des détails sur les sources de données #32
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
DATA_FILE_PARQUET_PATH=https://www.data.gouv.fr/fr/datasets/r/11cea8e8-df3e-4ed1-932b-781e2635e432
|
DATA_FILE_PARQUET_PATH=https://www.data.gouv.fr/fr/datasets/r/11cea8e8-df3e-4ed1-932b-781e2635e432
|
||||||
PORT=8050
|
PORT=8050
|
||||||
DEVELOPMENT=True
|
DEVELOPMENT=True
|
||||||
|
SOURCE_STATS_CSV_PATH="https://www.data.gouv.fr/api/1/datasets/r/8ded94de-3b80-4840-a5bb-7faad1c9c234"
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import json
|
|||||||
|
|
||||||
import plotly.express as px
|
import plotly.express as px
|
||||||
import polars as pl
|
import polars as pl
|
||||||
|
from dash import dash_table, html
|
||||||
|
|
||||||
|
|
||||||
def get_map_count_marches(lf: pl.LazyFrame):
|
def get_map_count_marches(lf: pl.LazyFrame):
|
||||||
@@ -112,3 +113,47 @@ def get_barchart_sources(lf: pl.LazyFrame, type_date: str):
|
|||||||
)
|
)
|
||||||
|
|
||||||
return fig
|
return fig
|
||||||
|
|
||||||
|
|
||||||
|
def get_sources_tables(source_path) -> html.Div:
|
||||||
|
df = pl.read_csv(source_path)
|
||||||
|
df = df.with_columns(
|
||||||
|
(
|
||||||
|
pl.lit('<a href = "')
|
||||||
|
+ pl.col("url")
|
||||||
|
+ pl.lit('">')
|
||||||
|
+ pl.col("nom")
|
||||||
|
+ pl.lit("</a>")
|
||||||
|
).alias("nom")
|
||||||
|
)
|
||||||
|
df = df.drop("url")
|
||||||
|
df = df.sort(by=["nb_marchés"], descending=True)
|
||||||
|
|
||||||
|
datatable = dash_table.DataTable(
|
||||||
|
id="source_table",
|
||||||
|
columns=[
|
||||||
|
{
|
||||||
|
"name": i,
|
||||||
|
"id": i,
|
||||||
|
"presentation": "markdown",
|
||||||
|
"type": "text",
|
||||||
|
"format": {"nully": "N/A"},
|
||||||
|
}
|
||||||
|
for i in df.schema.names()
|
||||||
|
],
|
||||||
|
style_cell_conditional=[
|
||||||
|
{
|
||||||
|
"if": {"column_id": ["nom", "organisation"]},
|
||||||
|
"minWidth": "350px",
|
||||||
|
"textAlign": "left",
|
||||||
|
"overflow": "hidden",
|
||||||
|
"lineHeight": "14px",
|
||||||
|
"whiteSpace": "normal",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
sort_action="native",
|
||||||
|
markdown_options={"html": True},
|
||||||
|
)
|
||||||
|
datatable.data = df.to_dicts()
|
||||||
|
|
||||||
|
return html.Div(children=datatable)
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
|
import os
|
||||||
|
|
||||||
from dash import dcc, html, register_page
|
from dash import dcc, html, register_page
|
||||||
|
|
||||||
|
from src.figures import get_sources_tables
|
||||||
|
|
||||||
title = "À propos"
|
title = "À propos"
|
||||||
|
|
||||||
register_page(
|
register_page(
|
||||||
@@ -43,6 +47,16 @@ les fonctionnalités actuelles de decp.info. Il est ainsi possible de rajouter
|
|||||||
- LinkedIn : [colinmaudry](https://www.linkedin.com/in/colinmaudry/)
|
- LinkedIn : [colinmaudry](https://www.linkedin.com/in/colinmaudry/)
|
||||||
"""
|
"""
|
||||||
),
|
),
|
||||||
|
html.H4("Sources de données", id="sources"),
|
||||||
|
get_sources_tables(os.getenv("SOURCE_STATS_CSV_PATH")),
|
||||||
|
html.H4("Mentions légales", id="mentions-legales"),
|
||||||
|
dcc.Markdown("""
|
||||||
|
Site Web développé et édité par [SAS Colmo](https://annuaire-entreprises.data.gouv.fr/entreprise/colmo-989393350), 989 393 350 RCS Rennes au capital de 3 000 euros.
|
||||||
|
|
||||||
|
Siège social : 1 carrefour Jouaust, 35000 Rennes
|
||||||
|
|
||||||
|
Hébergement : serveur situé en France et administré par Scaleway, 8 rue de la Ville l’Evêque, 75008 Paris
|
||||||
|
"""),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -15,13 +15,6 @@ layout = [
|
|||||||
className="container",
|
className="container",
|
||||||
children=[
|
children=[
|
||||||
html.H2(title),
|
html.H2(title),
|
||||||
dcc.Markdown("""
|
|
||||||
À savoir, les données suivantes existent mais sont en cours d'intégration dans ce projet :
|
|
||||||
|
|
||||||
- les données publiées dans le [format DECP 2019 (période 2018-2022)](https://www.data.gouv.fr/fr/datasets/donnees-essentielles-de-la-commande-publique-fichiers-consolides/#/resources/16962018-5c31-4296-9454-5998585496d2)
|
|
||||||
- les données [collectées par l'AIFE](https://github.com/ColinMaudry/decp-processing/issues/68) (API DUME, notamment achatpublic.info)
|
|
||||||
- les données [des plateformes Atexo](https://github.com/ColinMaudry/decp-processing/issues/57)
|
|
||||||
"""),
|
|
||||||
dcc.Loading(
|
dcc.Loading(
|
||||||
overlay_style={"visibility": "visible", "filter": "blur(2px)"},
|
overlay_style={"visibility": "visible", "filter": "blur(2px)"},
|
||||||
id="loading-1",
|
id="loading-1",
|
||||||
|
|||||||
Reference in New Issue
Block a user