edb-noumea 0.2.1__py3-none-any.whl → 0.2.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
edb_noumea/details.py CHANGED
@@ -85,6 +85,12 @@ def get_detailed_results():
85
85
  cleaned_df['e_coli_npp_100ml'] = pd.to_numeric(cleaned_df['e_coli_npp_100ml'], errors='coerce')
86
86
  cleaned_df['enterocoques_npp_100ml'] = pd.to_numeric(cleaned_df['enterocoques_npp_100ml'], errors='coerce')
87
87
  cleaned_df.fillna(0, inplace=True)
88
+
89
+ # Split de la colonne point_de_prelevement
90
+ split_points = cleaned_df['point_de_prelevement'].str.split(',', n=1, expand=True)
91
+ cleaned_df['id_point_prelevement'] = split_points[0].str.strip()
92
+ cleaned_df['desc_point_prelevement'] = split_points[1].str.strip() if split_points.shape[1] > 1 else ''
93
+
88
94
  return cleaned_df
89
95
 
90
96
  if __name__ == "__main__":
@@ -93,5 +99,7 @@ if __name__ == "__main__":
93
99
 
94
100
  # Afficher le DataFrame s'il a été créé avec succès
95
101
  if detailed_df is not None:
96
- print("\n📋 Voici les détails des derniers relevés :")
97
- print(detailed_df.to_string())
102
+ print("\n📋 Voici les détails des derniers relevés (toutes colonnes) :")
103
+ print(detailed_df)
104
+ print("\nColonnes du DataFrame :")
105
+ print(list(detailed_df.columns))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: edb-noumea
3
- Version: 0.2.1
3
+ Version: 0.2.2
4
4
  Summary: Un scraper pour la qualité des eaux de baignade à Nouméa.
5
5
  Project-URL: Homepage, https://github.com/adriens/edb-noumea
6
6
  Project-URL: Repository, https://github.com/adriens/edb-noumea
@@ -0,0 +1,8 @@
1
+ edb_noumea/__init__.py,sha256=G7WKTGLsr2wtW1E2jYpqq4miZLoSGhTifSE36CGNkLo,60
2
+ edb_noumea/details.py,sha256=ffHWTarKPgx-w5WcuClJMEPW-zYnCl_EEKgK0OWmmPo,4226
3
+ edb_noumea/main.py,sha256=KWT0ZGrHlbhEsQxi_Rw0Mm1syDIxoY-Px1yab94IbJc,2115
4
+ examples/generer_graphique_analyses.py,sha256=qFTsBoZeUwZVeJjdyQWhHTTCEn-FnJKKffNQWDXZH68,1690
5
+ edb_noumea-0.2.2.dist-info/METADATA,sha256=L5Umok2tPxkDsREP1U_c2NHEE36WnxOdNpbStv6gUzk,395
6
+ edb_noumea-0.2.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
7
+ edb_noumea-0.2.2.dist-info/top_level.txt,sha256=HO6xmPmVSX3DD7l-92iu5dbzULHN0ke793R40fBpyGU,20
8
+ edb_noumea-0.2.2.dist-info/RECORD,,
@@ -1 +1,2 @@
1
1
  edb_noumea
2
+ examples
@@ -0,0 +1,42 @@
1
+ import pandas as pd
2
+ import matplotlib.pyplot as plt
3
+ from edb_noumea.details import get_detailed_results
4
+
5
+ # Obtenir les données détaillées
6
+ df = get_detailed_results()
7
+
8
+ if df is not None and not df.empty:
9
+ print("Création du graphique E. coli...")
10
+
11
+ # Trier les données par E. coli pour une meilleure lisibilité
12
+ df_sorted_ecoli = df.sort_values(by='e_coli_npp_100ml', ascending=False)
13
+
14
+ # Créer le graphique à barres horizontales pour E. coli
15
+ plt.figure(figsize=(12, 8))
16
+ plt.barh(df_sorted_ecoli['point_de_prelevement'], df_sorted_ecoli['e_coli_npp_100ml'], color='skyblue')
17
+ plt.xlabel('E. coli (NPP/100ml)')
18
+ plt.ylabel('Point de prélèvement')
19
+ plt.title("Niveaux d'E. coli par Point de Prélèvement")
20
+ plt.gca().invert_yaxis()
21
+ plt.tight_layout()
22
+ plt.savefig('ecoli_levels.png')
23
+ print("Graphique E. coli sauvegardé sous 'ecoli_levels.png'")
24
+ plt.close()
25
+
26
+ print("Création du graphique Entérocoques...")
27
+ # Trier les données par Entérocoques
28
+ df_sorted_entero = df.sort_values(by='enterocoques_npp_100ml', ascending=False)
29
+
30
+ # Créer le graphique à barres horizontales pour Entérocoques
31
+ plt.figure(figsize=(12, 8))
32
+ plt.barh(df_sorted_entero['point_de_prelevement'], df_sorted_entero['enterocoques_npp_100ml'], color='salmon')
33
+ plt.xlabel('Entérocoques (NPP/100ml)')
34
+ plt.ylabel('Point de prélèvement')
35
+ plt.title("Niveaux d'Entérocoques par Point de Prélèvement")
36
+ plt.gca().invert_yaxis()
37
+ plt.tight_layout()
38
+ plt.savefig('entero_levels.png')
39
+ print("Graphique Entérocoques sauvegardé sous 'entero_levels.png'")
40
+ plt.close()
41
+ else:
42
+ print("Aucune donnée à afficher.")
@@ -1,7 +0,0 @@
1
- edb_noumea/__init__.py,sha256=G7WKTGLsr2wtW1E2jYpqq4miZLoSGhTifSE36CGNkLo,60
2
- edb_noumea/details.py,sha256=FWKmq9op4mbX5DpWyrAUxK2wP1r7vuyt6nqdrTk-IHk,3823
3
- edb_noumea/main.py,sha256=KWT0ZGrHlbhEsQxi_Rw0Mm1syDIxoY-Px1yab94IbJc,2115
4
- edb_noumea-0.2.1.dist-info/METADATA,sha256=k3Nb5FYSKXA_-xgRs5zosijSW3I3C8N0HHYKxt_SOJo,395
5
- edb_noumea-0.2.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
6
- edb_noumea-0.2.1.dist-info/top_level.txt,sha256=Dj3JusM0b5H9_f9yZeO-IwucCZzI1OHSjLMKtvRjq6k,11
7
- edb_noumea-0.2.1.dist-info/RECORD,,