Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ee91e7a91f | |||
| 392f862baa | |||
| 199476ec30 | |||
| c98a36f759 |
@@ -1,6 +1,6 @@
|
|||||||
# decp.info
|
# decp.info
|
||||||
|
|
||||||
> v2.1.4
|
> v2.1.6
|
||||||
|
|
||||||
Outil d'exploration et de téléchargement des données essentielles de la commande publique.
|
Outil d'exploration et de téléchargement des données essentielles de la commande publique.
|
||||||
|
|
||||||
@@ -38,6 +38,10 @@ Ne pas oublier de mettre à jour les fichier .env.
|
|||||||
|
|
||||||
## Notes de version
|
## Notes de version
|
||||||
|
|
||||||
|
##### 2.1.6 (15 octobre 2025)
|
||||||
|
|
||||||
|
- Stabilisation de la vue marché
|
||||||
|
|
||||||
##### 2.1.5 (10 octobre 2025)
|
##### 2.1.5 (10 octobre 2025)
|
||||||
|
|
||||||
- réparation des filtres (notamment < > sur les montants)
|
- réparation des filtres (notamment < > sur les montants)
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "decp.info"
|
name = "decp.info"
|
||||||
description = "Interface d'exploration et d'analyse des marchés publics français."
|
description = "Interface d'exploration et d'analyse des marchés publics français."
|
||||||
version = "2.1.5"
|
version = "2.1.6"
|
||||||
requires-python = ">= 3.10"
|
requires-python = ">= 3.10"
|
||||||
authors = [
|
authors = [
|
||||||
{ name = "Colin Maudry", email = "colin+decp@maudry.com" }
|
{ name = "Colin Maudry", email = "colin+decp@maudry.com" }
|
||||||
|
|||||||
+2
-8
@@ -66,6 +66,7 @@ def get_marche_data(url) -> tuple[dict, list]:
|
|||||||
marche_uid = url.split("/")[-1]
|
marche_uid = url.split("/")[-1]
|
||||||
|
|
||||||
# Récupération des données du marché à partir du df global
|
# Récupération des données du marché à partir du df global
|
||||||
|
|
||||||
lff = df.lazy()
|
lff = df.lazy()
|
||||||
lff = lff.filter(pl.col("uid") == pl.lit(marche_uid))
|
lff = lff.filter(pl.col("uid") == pl.lit(marche_uid))
|
||||||
|
|
||||||
@@ -73,13 +74,9 @@ def get_marche_data(url) -> tuple[dict, list]:
|
|||||||
dff_titulaires = lff.select(cs.starts_with("titulaire")).collect(engine="streaming")
|
dff_titulaires = lff.select(cs.starts_with("titulaire")).collect(engine="streaming")
|
||||||
|
|
||||||
# Données du marché
|
# Données du marché
|
||||||
dff_marche = (
|
dff_marche = lff.unique("uid").collect(engine="streaming")
|
||||||
lff.select(~cs.starts_with("titulaires")).unique().collect(engine="streaming")
|
|
||||||
)
|
|
||||||
dff_marche = format_montant(dff_marche)
|
dff_marche = format_montant(dff_marche)
|
||||||
|
|
||||||
assert dff_marche.height == 1
|
|
||||||
|
|
||||||
return dff_marche.to_dicts()[0], dff_titulaires.to_dicts()
|
return dff_marche.to_dicts()[0], dff_titulaires.to_dicts()
|
||||||
|
|
||||||
|
|
||||||
@@ -93,7 +90,6 @@ def get_marche_data(url) -> tuple[dict, list]:
|
|||||||
def update_marche_info(marche, titulaires):
|
def update_marche_info(marche, titulaires):
|
||||||
def make_parameter(col):
|
def make_parameter(col):
|
||||||
column_object = data_schema.get(col)
|
column_object = data_schema.get(col)
|
||||||
print(column_object)
|
|
||||||
column_name = column_object.get("title") if column_object else col
|
column_name = column_object.get("title") if column_object else col
|
||||||
|
|
||||||
if marche[col]:
|
if marche[col]:
|
||||||
@@ -110,8 +106,6 @@ def update_marche_info(marche, titulaires):
|
|||||||
|
|
||||||
# Dates
|
# Dates
|
||||||
elif col in ["dateNotification", "datePublicationDonnees"]:
|
elif col in ["dateNotification", "datePublicationDonnees"]:
|
||||||
print(marche[col])
|
|
||||||
|
|
||||||
value = datetime.fromisoformat(marche[col]).strftime("%d/%m/%Y")
|
value = datetime.fromisoformat(marche[col]).strftime("%d/%m/%Y")
|
||||||
|
|
||||||
# Listes
|
# Listes
|
||||||
|
|||||||
@@ -126,6 +126,7 @@ def format_number(number) -> str:
|
|||||||
def format_montant(dff: pl.DataFrame) -> pl.DataFrame:
|
def format_montant(dff: pl.DataFrame) -> pl.DataFrame:
|
||||||
def format_function(expr, scale=None):
|
def format_function(expr, scale=None):
|
||||||
# https://stackoverflow.com/a/78636786
|
# https://stackoverflow.com/a/78636786
|
||||||
|
expr = expr.cast(pl.String)
|
||||||
expr = expr.str.splitn(".", 2)
|
expr = expr.str.splitn(".", 2)
|
||||||
|
|
||||||
num = expr.struct[0]
|
num = expr.struct[0]
|
||||||
|
|||||||
Reference in New Issue
Block a user