edb-noumea 0.3.0__py3-none-any.whl → 0.3.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 +19 -10
- {edb_noumea-0.3.0.dist-info → edb_noumea-0.3.2.dist-info}/METADATA +4 -3
- edb_noumea-0.3.2.dist-info/RECORD +8 -0
- edb_noumea-0.3.2.dist-info/licenses/LICENSE +21 -0
- edb_noumea-0.3.0.dist-info/RECORD +0 -7
- {edb_noumea-0.3.0.dist-info → edb_noumea-0.3.2.dist-info}/WHEEL +0 -0
- {edb_noumea-0.3.0.dist-info → edb_noumea-0.3.2.dist-info}/top_level.txt +0 -0
edb_noumea/details.py
CHANGED
|
@@ -21,7 +21,7 @@ def get_pdf_url():
|
|
|
21
21
|
return get_latest_pdf_url()
|
|
22
22
|
|
|
23
23
|
import pandas as pd
|
|
24
|
-
import
|
|
24
|
+
import pdfplumber
|
|
25
25
|
import requests
|
|
26
26
|
import io
|
|
27
27
|
from bs4 import BeautifulSoup
|
|
@@ -76,20 +76,29 @@ def get_detailed_results():
|
|
|
76
76
|
pdf_file = io.BytesIO(response.content)
|
|
77
77
|
|
|
78
78
|
try:
|
|
79
|
-
print("🔍 Extraction des tableaux du PDF...")
|
|
80
|
-
|
|
79
|
+
print("🔍 Extraction des tableaux du PDF avec pdfplumber...")
|
|
80
|
+
with pdfplumber.open(pdf_file) as pdf:
|
|
81
|
+
if not pdf.pages:
|
|
82
|
+
print("❌ Le PDF ne contient aucune page.")
|
|
83
|
+
return None
|
|
84
|
+
|
|
85
|
+
first_page = pdf.pages[0]
|
|
86
|
+
tables = first_page.extract_tables()
|
|
87
|
+
|
|
88
|
+
if not tables:
|
|
89
|
+
print("❌ Aucun tableau n'a été trouvé dans le PDF.")
|
|
90
|
+
return None
|
|
91
|
+
|
|
92
|
+
print(f"✅ {len(tables)} tableau(x) trouvé(s) sur la première page.")
|
|
93
|
+
# Convertir le premier tableau en DataFrame
|
|
94
|
+
table_data = tables[0]
|
|
95
|
+
df = pd.DataFrame(table_data[1:], columns=table_data[0])
|
|
96
|
+
|
|
81
97
|
except Exception as e:
|
|
82
98
|
print(f"❌ Une erreur est survenue lors de l'extraction des données du PDF.")
|
|
83
|
-
print("ℹ️ Cela peut être dû à l'absence de Java sur votre système, qui est requis par la bibliothèque 'tabula-py'.")
|
|
84
99
|
print(f" Erreur originale : {e}")
|
|
85
100
|
return None
|
|
86
101
|
|
|
87
|
-
if not tables:
|
|
88
|
-
print("❌ Aucun tableau n'a été trouvé dans le PDF.")
|
|
89
|
-
return None
|
|
90
|
-
|
|
91
|
-
print(f"✅ {len(tables)} tableau(x) trouvé(s). Affichage du premier.")
|
|
92
|
-
df = tables[0]
|
|
93
102
|
print("\n--- Aperçu du tableau extrait (toutes colonnes) ---")
|
|
94
103
|
with pd.option_context('display.max_columns', None):
|
|
95
104
|
print(df)
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: edb-noumea
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.2
|
|
4
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
|
+
License-File: LICENSE
|
|
7
8
|
Requires-Dist: requests
|
|
8
9
|
Requires-Dist: beautifulsoup4
|
|
9
10
|
Requires-Dist: pandas
|
|
10
11
|
Requires-Dist: lxml
|
|
11
|
-
Requires-Dist:
|
|
12
|
-
Requires-Dist: jpype1
|
|
12
|
+
Requires-Dist: pdfplumber
|
|
13
13
|
Requires-Dist: matplotlib
|
|
14
|
+
Dynamic: license-file
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
edb_noumea/__init__.py,sha256=G7WKTGLsr2wtW1E2jYpqq4miZLoSGhTifSE36CGNkLo,60
|
|
2
|
+
edb_noumea/details.py,sha256=R0lnEeYL1C-BKPaJhySq3N1H1sFZ4yNOkEcKP3g59dg,8026
|
|
3
|
+
edb_noumea/main.py,sha256=KWT0ZGrHlbhEsQxi_Rw0Mm1syDIxoY-Px1yab94IbJc,2115
|
|
4
|
+
edb_noumea-0.3.2.dist-info/licenses/LICENSE,sha256=mNQ0SS064BtPKYHabMRg2yM3m-GDX4MgDQ6ZnDFiueI,1100
|
|
5
|
+
edb_noumea-0.3.2.dist-info/METADATA,sha256=WBWP0xNI2e8txiTvqCetbQeMNuPS0lj8QF251zW3JqA,518
|
|
6
|
+
edb_noumea-0.3.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
7
|
+
edb_noumea-0.3.2.dist-info/top_level.txt,sha256=Dj3JusM0b5H9_f9yZeO-IwucCZzI1OHSjLMKtvRjq6k,11
|
|
8
|
+
edb_noumea-0.3.2.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Adrien SALES x.com/rastadidi dev.to/adriens
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
edb_noumea/__init__.py,sha256=G7WKTGLsr2wtW1E2jYpqq4miZLoSGhTifSE36CGNkLo,60
|
|
2
|
-
edb_noumea/details.py,sha256=8HYMPTcwcM66saOIFFiCMYrWpBB6iE4AN2PSstNK9uY,7731
|
|
3
|
-
edb_noumea/main.py,sha256=KWT0ZGrHlbhEsQxi_Rw0Mm1syDIxoY-Px1yab94IbJc,2115
|
|
4
|
-
edb_noumea-0.3.0.dist-info/METADATA,sha256=Uf87zUeSb-sVkS6NPz5ZwEAsvFZD1fWfIfPGMSVcfBQ,495
|
|
5
|
-
edb_noumea-0.3.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
6
|
-
edb_noumea-0.3.0.dist-info/top_level.txt,sha256=Dj3JusM0b5H9_f9yZeO-IwucCZzI1OHSjLMKtvRjq6k,11
|
|
7
|
-
edb_noumea-0.3.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|