edb-noumea 0.2.6__tar.gz → 0.2.8__tar.gz
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-0.2.6 → edb_noumea-0.2.8}/PKG-INFO +1 -1
- {edb_noumea-0.2.6 → edb_noumea-0.2.8}/edb_noumea/details.py +49 -21
- {edb_noumea-0.2.6 → edb_noumea-0.2.8}/edb_noumea.egg-info/PKG-INFO +1 -1
- {edb_noumea-0.2.6 → edb_noumea-0.2.8}/pyproject.toml +1 -1
- {edb_noumea-0.2.6 → edb_noumea-0.2.8}/README.md +0 -0
- {edb_noumea-0.2.6 → edb_noumea-0.2.8}/edb_noumea/__init__.py +0 -0
- {edb_noumea-0.2.6 → edb_noumea-0.2.8}/edb_noumea/main.py +0 -0
- {edb_noumea-0.2.6 → edb_noumea-0.2.8}/edb_noumea.egg-info/SOURCES.txt +0 -0
- {edb_noumea-0.2.6 → edb_noumea-0.2.8}/edb_noumea.egg-info/dependency_links.txt +0 -0
- {edb_noumea-0.2.6 → edb_noumea-0.2.8}/edb_noumea.egg-info/requires.txt +0 -0
- {edb_noumea-0.2.6 → edb_noumea-0.2.8}/edb_noumea.egg-info/top_level.txt +0 -0
- {edb_noumea-0.2.6 → edb_noumea-0.2.8}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: edb-noumea
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.8
|
|
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
|
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
import pandas as pd
|
|
2
|
+
|
|
3
|
+
@staticmethod
|
|
4
|
+
def get_sites():
|
|
5
|
+
"""
|
|
6
|
+
Retourne un DataFrame avec le mapping site/plage/gmaps_url.
|
|
7
|
+
"""
|
|
8
|
+
data = [
|
|
9
|
+
{"site": "PLAGE DE LA BAIE DES CITRONS", "plage": "Plage de la baie des Citrons", "gmaps_url": "https://maps.app.goo.gl/P2SP3oWuQbxd1sCH9"},
|
|
10
|
+
{"site": "PLAGE DE L'ANSE VATA", "plage": "Plage de l'Anse-Vata", "gmaps_url": "https://maps.app.goo.gl/xAUdky47DqEjSF4R8"},
|
|
11
|
+
{"site": "PLAGE DE LA POINTE MAGNIN", "plage": "Plage de la pointe Magnin", "gmaps_url": "https://maps.app.goo.gl/Wf69LoGgc894MtQy6"},
|
|
12
|
+
{"site": "PLAGE DE LA PROMENADE PIERRE VERNIER", "plage": "Plage de la promenade Pierre-Vernier", "gmaps_url": "https://maps.app.goo.gl/bNocZKVVMYk3HFYs9"},
|
|
13
|
+
{"site": "PLAGE DE MAGENTA", "plage": "Plage de Magenta", "gmaps_url": "https://maps.app.goo.gl/yFwgG2BCV1sEtPWP6"},
|
|
14
|
+
{"site": "PLAGE DU KUENDU BEACH", "plage": "Plage du Kuendu Beach", "gmaps_url": "https://maps.app.goo.gl/oGY6Hy4KCXJWxqfL9"},
|
|
15
|
+
]
|
|
16
|
+
return pd.DataFrame(data)
|
|
1
17
|
def get_pdf_url():
|
|
2
18
|
"""
|
|
3
19
|
Alias public pour obtenir l'URL du dernier PDF d'analyses détaillées.
|
|
@@ -74,30 +90,42 @@ def get_detailed_results():
|
|
|
74
90
|
|
|
75
91
|
print(f"✅ {len(tables)} tableau(x) trouvé(s). Affichage du premier.")
|
|
76
92
|
df = tables[0]
|
|
93
|
+
print("\n--- Aperçu du tableau extrait (toutes colonnes) ---")
|
|
94
|
+
with pd.option_context('display.max_columns', None):
|
|
95
|
+
print(df)
|
|
96
|
+
print("\nColonnes:", list(df.columns))
|
|
97
|
+
print("Shape:", df.shape)
|
|
77
98
|
|
|
78
|
-
#
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
99
|
+
# Sélectionne et renomme les colonnes demandées
|
|
100
|
+
columns_map = {
|
|
101
|
+
'Unnamed: 0': 'Nom du site de baignade',
|
|
102
|
+
'Unnamed: 1': 'Point de prélèvement',
|
|
103
|
+
'Unnamed: 2': 'Date du prélèvement',
|
|
104
|
+
'Unnamed: 3': 'Heure du prélèvement',
|
|
105
|
+
'Escherichia': 'Escherichia coli (NPP/100ml)',
|
|
106
|
+
'Entérocoques': 'Entérocoques intestinaux (NPP/100ml)'
|
|
86
107
|
}
|
|
87
|
-
cleaned_df = df[
|
|
88
|
-
|
|
89
|
-
cleaned_df.
|
|
90
|
-
|
|
91
|
-
cleaned_df
|
|
92
|
-
|
|
108
|
+
cleaned_df = df[list(columns_map.keys())].rename(columns=columns_map)
|
|
109
|
+
# Supprime la première ligne (ligne d'en-tête du PDF)
|
|
110
|
+
cleaned_df = cleaned_df.iloc[1:].reset_index(drop=True)
|
|
111
|
+
# Renomme les colonnes pour correspondre au style Python
|
|
112
|
+
cleaned_df = cleaned_df.rename(columns={
|
|
113
|
+
"Nom du site de baignade": "site",
|
|
114
|
+
"Point de prélèvement": "point_de_prelevement",
|
|
115
|
+
"Date du prélèvement": "date",
|
|
116
|
+
"Heure du prélèvement": "heure",
|
|
117
|
+
"Escherichia coli (NPP/100ml)": "e_coli_npp_100ml",
|
|
118
|
+
"Entérocoques intestinaux (NPP/100ml)": "enterocoques_npp_100ml"
|
|
119
|
+
})
|
|
93
120
|
|
|
94
|
-
#
|
|
95
|
-
split_points = cleaned_df[
|
|
96
|
-
cleaned_df[
|
|
97
|
-
cleaned_df[
|
|
121
|
+
# Ajoute deux colonnes issues du split de 'point_de_prelevement'
|
|
122
|
+
split_points = cleaned_df["point_de_prelevement"].str.split(",", n=1, expand=True)
|
|
123
|
+
cleaned_df["id_point_prelevement"] = split_points[0].str.strip()
|
|
124
|
+
cleaned_df["desc_point_prelevement"] = split_points[1].str.strip() if split_points.shape[1] > 1 else ""
|
|
98
125
|
|
|
99
|
-
#
|
|
100
|
-
|
|
126
|
+
# S'assurer que la colonne 'heure' est bien présente et de type string
|
|
127
|
+
if "heure" in cleaned_df.columns:
|
|
128
|
+
cleaned_df["heure"] = cleaned_df["heure"].astype(str)
|
|
101
129
|
|
|
102
130
|
return cleaned_df
|
|
103
131
|
|
|
@@ -110,4 +138,4 @@ if __name__ == "__main__":
|
|
|
110
138
|
print("\n📋 Voici les détails des derniers relevés (toutes colonnes) :")
|
|
111
139
|
print(detailed_df)
|
|
112
140
|
print("\nColonnes du DataFrame :")
|
|
113
|
-
print(list(detailed_df.columns))
|
|
141
|
+
#print(list(detailed_df.columns))
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: edb-noumea
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.8
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|