edb-noumea 0.2.15__tar.gz → 0.3.0__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.15 → edb_noumea-0.3.0}/PKG-INFO +2 -2
- {edb_noumea-0.2.15 → edb_noumea-0.3.0}/edb_noumea/details.py +26 -13
- {edb_noumea-0.2.15 → edb_noumea-0.3.0}/edb_noumea.egg-info/PKG-INFO +2 -2
- {edb_noumea-0.2.15 → edb_noumea-0.3.0}/pyproject.toml +2 -2
- {edb_noumea-0.2.15 → edb_noumea-0.3.0}/README.md +0 -0
- {edb_noumea-0.2.15 → edb_noumea-0.3.0}/edb_noumea/__init__.py +0 -0
- {edb_noumea-0.2.15 → edb_noumea-0.3.0}/edb_noumea/main.py +0 -0
- {edb_noumea-0.2.15 → edb_noumea-0.3.0}/edb_noumea.egg-info/SOURCES.txt +0 -0
- {edb_noumea-0.2.15 → edb_noumea-0.3.0}/edb_noumea.egg-info/dependency_links.txt +0 -0
- {edb_noumea-0.2.15 → edb_noumea-0.3.0}/edb_noumea.egg-info/requires.txt +0 -0
- {edb_noumea-0.2.15 → edb_noumea-0.3.0}/edb_noumea.egg-info/top_level.txt +0 -0
- {edb_noumea-0.2.15 → edb_noumea-0.3.0}/setup.cfg +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: edb-noumea
|
|
3
|
-
Version: 0.
|
|
4
|
-
Summary:
|
|
3
|
+
Version: 0.3.0
|
|
4
|
+
Summary: Scraper robuste pour la qualité des eaux de baignade à Nouméa. Ajout export CSV automatique et détection améliorée des colonnes PDF.
|
|
5
5
|
Project-URL: Homepage, https://github.com/adriens/edb-noumea
|
|
6
6
|
Project-URL: Repository, https://github.com/adriens/edb-noumea
|
|
7
7
|
Requires-Dist: requests
|
|
@@ -96,23 +96,33 @@ def get_detailed_results():
|
|
|
96
96
|
print("\nColonnes:", list(df.columns))
|
|
97
97
|
print("Shape:", df.shape)
|
|
98
98
|
|
|
99
|
-
#
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
99
|
+
# Nettoyer les noms de colonnes pour faciliter la recherche
|
|
100
|
+
def clean_col(col):
|
|
101
|
+
return str(col).replace("Unnamed:", "").replace("_", " ").replace("\xa0", " ").replace("\n", " ").replace("duprélèvement", "du prélèvement").strip().lower()
|
|
102
|
+
|
|
103
|
+
cleaned_columns = {clean_col(col): col for col in df.columns if not str(col).startswith("Unnamed")}
|
|
104
|
+
|
|
105
|
+
def find_col(possibles):
|
|
106
|
+
for key, col in cleaned_columns.items():
|
|
107
|
+
for possible in possibles:
|
|
108
|
+
if possible in key:
|
|
109
|
+
return col
|
|
110
|
+
return None
|
|
111
|
+
|
|
112
|
+
site_col = find_col(["nom du site"])
|
|
113
|
+
point_prelevement_col = find_col(["point de prélèvement"])
|
|
114
|
+
date_col = find_col(["date du prélèvement"])
|
|
115
|
+
heure_col = find_col(["heure du prélèvement", "heure"])
|
|
116
|
+
e_coli_col = find_col(["escherichia", "coli"])
|
|
117
|
+
entero_col = find_col(["entérocoques"])
|
|
118
|
+
|
|
119
|
+
# Vérification des colonnes requises
|
|
111
120
|
if not all([site_col, point_prelevement_col, date_col, heure_col, e_coli_col, entero_col]):
|
|
112
121
|
print(f"❌ Certaines colonnes requises n'ont pas été trouvées. Colonnes disponibles : {list(df.columns)}")
|
|
122
|
+
print(f"Colonnes nettoyées : {list(cleaned_columns.keys())}")
|
|
113
123
|
return None
|
|
114
124
|
|
|
115
|
-
#
|
|
125
|
+
# Sélection et renommage
|
|
116
126
|
cleaned_df = df.loc[:, [site_col, point_prelevement_col, date_col, heure_col, e_coli_col, entero_col]].copy()
|
|
117
127
|
cleaned_df.columns = [
|
|
118
128
|
"site",
|
|
@@ -161,3 +171,6 @@ if __name__ == "__main__":
|
|
|
161
171
|
"e_coli_npp_100ml",
|
|
162
172
|
"enterocoques_npp_100ml"
|
|
163
173
|
]])
|
|
174
|
+
# Export CSV
|
|
175
|
+
detailed_df.to_csv("details_dernier_releve.csv", index=False)
|
|
176
|
+
print("\n✅ Export CSV : details_dernier_releve.csv")
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: edb-noumea
|
|
3
|
-
Version: 0.
|
|
4
|
-
Summary:
|
|
3
|
+
Version: 0.3.0
|
|
4
|
+
Summary: Scraper robuste pour la qualité des eaux de baignade à Nouméa. Ajout export CSV automatique et détection améliorée des colonnes PDF.
|
|
5
5
|
Project-URL: Homepage, https://github.com/adriens/edb-noumea
|
|
6
6
|
Project-URL: Repository, https://github.com/adriens/edb-noumea
|
|
7
7
|
Requires-Dist: requests
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "edb-noumea"
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
description = "Scraper robuste pour la qualité des eaux de baignade à Nouméa. Ajout export CSV automatique et détection améliorée des colonnes PDF."
|
|
4
|
+
version = "0.3.0"
|
|
5
5
|
dependencies = [
|
|
6
6
|
"requests",
|
|
7
7
|
"beautifulsoup4",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|