warn-scraper 1.2.151.dev0__py3-none-any.whl → 1.2.152.dev0__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.
- warn/scrapers/al.py +5 -1
- warn/utils.py +3 -3
- {warn_scraper-1.2.151.dev0.dist-info → warn_scraper-1.2.152.dev0.dist-info}/METADATA +1 -1
- {warn_scraper-1.2.151.dev0.dist-info → warn_scraper-1.2.152.dev0.dist-info}/RECORD +8 -8
- {warn_scraper-1.2.151.dev0.dist-info → warn_scraper-1.2.152.dev0.dist-info}/WHEEL +0 -0
- {warn_scraper-1.2.151.dev0.dist-info → warn_scraper-1.2.152.dev0.dist-info}/entry_points.txt +0 -0
- {warn_scraper-1.2.151.dev0.dist-info → warn_scraper-1.2.152.dev0.dist-info}/licenses/LICENSE +0 -0
- {warn_scraper-1.2.151.dev0.dist-info → warn_scraper-1.2.152.dev0.dist-info}/top_level.txt +0 -0
warn/scrapers/al.py
CHANGED
|
@@ -32,11 +32,15 @@ def scrape(
|
|
|
32
32
|
Returns: the Path where the file is written
|
|
33
33
|
"""
|
|
34
34
|
output_csv = data_dir / "al.csv"
|
|
35
|
-
page = utils.get_url("https://www.madeinalabama.com/warn-list/")
|
|
35
|
+
# page = utils.get_url("https://www.madeinalabama.com/warn-list/")
|
|
36
|
+
# URL change in June 2026, maybe led to a HTTP 415 error
|
|
37
|
+
page = utils.get_url("https://workforce.alabama.gov/warn-list/")
|
|
38
|
+
|
|
36
39
|
# can't see 2020 listings when I open web page, but they are on the summary in the google search
|
|
37
40
|
soup = BeautifulSoup(page.text, "html.parser")
|
|
38
41
|
table = soup.find_all("table") # output is list-type
|
|
39
42
|
table_rows = table[0].find_all("tr")
|
|
43
|
+
logger.debug(f"{len(table_rows):,} total table rows (including header) found")
|
|
40
44
|
# Handle the header
|
|
41
45
|
raw_header = table_rows.pop(0)
|
|
42
46
|
header_row = _extract_fields_from_row(raw_header, "th")
|
warn/utils.py
CHANGED
|
@@ -213,7 +213,7 @@ def write_rows_to_csv(output_path: Path, rows: list, mode="w"):
|
|
|
213
213
|
mode (str): the mode to be used when opening the file (default 'w')
|
|
214
214
|
"""
|
|
215
215
|
create_directory(output_path, is_file=True)
|
|
216
|
-
logger.debug(f"Writing {len(rows)} rows to {output_path}")
|
|
216
|
+
logger.debug(f"Writing {len(rows):,} rows to {output_path}")
|
|
217
217
|
with open(output_path, mode, newline="", encoding="utf-8") as f:
|
|
218
218
|
writer = csv.writer(f)
|
|
219
219
|
writer.writerows(rows)
|
|
@@ -230,7 +230,7 @@ def write_dict_rows_to_csv(output_path, headers, rows, mode="w", extrasaction="r
|
|
|
230
230
|
extrasaction (str): what to do if the if a field isn't in the headers (default 'raise')
|
|
231
231
|
"""
|
|
232
232
|
create_directory(output_path, is_file=True)
|
|
233
|
-
logger.debug(f"Writing {len(rows)} rows to {output_path}")
|
|
233
|
+
logger.debug(f"Writing {len(rows):,} rows to {output_path}")
|
|
234
234
|
with open(output_path, mode, newline="") as f:
|
|
235
235
|
# Create the writer object
|
|
236
236
|
writer = csv.DictWriter(f, fieldnames=headers, extrasaction=extrasaction)
|
|
@@ -258,7 +258,7 @@ def write_disparate_dict_rows_to_csv(output_path, rows, mode="w"):
|
|
|
258
258
|
headers.add(item)
|
|
259
259
|
headers = list(sorted(headers))
|
|
260
260
|
logger.debug(f"Found {len(headers):,} header entries in list of dicts.")
|
|
261
|
-
logger.debug(f"Writing {len(rows)} rows to {output_path}")
|
|
261
|
+
logger.debug(f"Writing {len(rows):,} rows to {output_path}")
|
|
262
262
|
with open(output_path, mode, newline="") as outfile:
|
|
263
263
|
# Create the writer object
|
|
264
264
|
writer = csv.writer(outfile)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: warn-scraper
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.152.dev0
|
|
4
4
|
Summary: Command-line interface for downloading WARN Act notices of qualified plant closings and mass layoffs from state government websites
|
|
5
5
|
Author-email: Big Local News <biglocalnews@stanford.edu>
|
|
6
6
|
License-Expression: Apache-2.0
|
|
@@ -2,7 +2,7 @@ warn/__init__.py,sha256=A07JFY1TyaPtVIndBa7IvTk13DETqIkLgRdk0A-MCoE,85
|
|
|
2
2
|
warn/cache.py,sha256=QBSHycchvRTkOQfHptOtZeTYiPgLP383jS8MTiGln_c,5969
|
|
3
3
|
warn/cli.py,sha256=ZqyJwICdHFkn2hEgbArj_upbElR9-TSDlYDqyEGeexE,2019
|
|
4
4
|
warn/runner.py,sha256=oeGRybGwpnkQKlPzRMlKxhsDt1GN4PZoX-vUwrsPgos,1894
|
|
5
|
-
warn/utils.py,sha256=
|
|
5
|
+
warn/utils.py,sha256=95aNYviHGvcB4kP96qHnzs6uVTDesE3karvYq5eESsM,12259
|
|
6
6
|
warn/platforms/__init__.py,sha256=wIZRDf4tbTuC8oKM4ZrTAtwNgbtMQGzPXMwDYCFyrog,81
|
|
7
7
|
warn/platforms/job_center/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
8
|
warn/platforms/job_center/cache.py,sha256=yhA3sE46lNFg8vEewSoRYVByi0YSlkBiKm7qoSUiTdM,1868
|
|
@@ -11,7 +11,7 @@ warn/platforms/job_center/urls.py,sha256=IWhpuzN_xcNdHh23GbZPGvuHCsMcmb03qx3pRn1
|
|
|
11
11
|
warn/platforms/job_center/utils.py,sha256=HdUKgKirmpPP7e4Cu_ZyB3zPVS_p-_ylo-lXFhxK2QM,5696
|
|
12
12
|
warn/scrapers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
13
13
|
warn/scrapers/ak.py,sha256=h7BYMTV0whwWAPhbzVDVKMMoVCFphKly70aiTHabPq4,1847
|
|
14
|
-
warn/scrapers/al.py,sha256=
|
|
14
|
+
warn/scrapers/al.py,sha256=XSDEGC7F6_3GZ2m_uSiIG-1v8jMNH9pw_wNUCZyaMK0,2460
|
|
15
15
|
warn/scrapers/az.py,sha256=elGbue01Gjf_DQ66Wy9qqGIOJsiY-KIKJOVeft8pCXg,1447
|
|
16
16
|
warn/scrapers/ca.py,sha256=VQOfjHXPCc-jYwh-EPGVVfnzvXB7pdmCt2uJ6QnMPRM,8600
|
|
17
17
|
warn/scrapers/co.py,sha256=83OdikIrWGxt22mlI-_zLSNqJg1NO5C2Xjm3FF6DPYY,18252
|
|
@@ -51,9 +51,9 @@ warn/scrapers/va.py,sha256=7Nle7qL0VNPiE653XyaP9HQqSfuJFDRr2kEkjOqLvFM,11269
|
|
|
51
51
|
warn/scrapers/vt.py,sha256=d-bo4WK2hkrk4BhCCmLpEovcoZltlvdIUB6O0uaMx5A,1186
|
|
52
52
|
warn/scrapers/wa.py,sha256=UXdVtHZo_a-XfoiyOooTRfTb9W3PErSZdKca6SRORgs,4282
|
|
53
53
|
warn/scrapers/wi.py,sha256=ClEzXkwZbop0W4fkQgsb5oHAPUrb4luUPGV-jOKwkcg,4855
|
|
54
|
-
warn_scraper-1.2.
|
|
55
|
-
warn_scraper-1.2.
|
|
56
|
-
warn_scraper-1.2.
|
|
57
|
-
warn_scraper-1.2.
|
|
58
|
-
warn_scraper-1.2.
|
|
59
|
-
warn_scraper-1.2.
|
|
54
|
+
warn_scraper-1.2.152.dev0.dist-info/licenses/LICENSE,sha256=ZV-QHyqPwyMuwuj0lI05JeSjV1NyzVEk8Yeu7FPtYS0,585
|
|
55
|
+
warn_scraper-1.2.152.dev0.dist-info/METADATA,sha256=7URJSlssMUA03pk1xFWJebi5HmfTOcAjBxgTqzHlf6s,1780
|
|
56
|
+
warn_scraper-1.2.152.dev0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
57
|
+
warn_scraper-1.2.152.dev0.dist-info/entry_points.txt,sha256=poh_oSweObGlBSs1_2qZmnTodlOYD0KfO7-h7W2UQIw,47
|
|
58
|
+
warn_scraper-1.2.152.dev0.dist-info/top_level.txt,sha256=dZfms6N3kqVXufiPOo7YqOrAcUtYfNH_oyGvYUk9FB4,5
|
|
59
|
+
warn_scraper-1.2.152.dev0.dist-info/RECORD,,
|
|
File without changes
|
{warn_scraper-1.2.151.dev0.dist-info → warn_scraper-1.2.152.dev0.dist-info}/entry_points.txt
RENAMED
|
File without changes
|
{warn_scraper-1.2.151.dev0.dist-info → warn_scraper-1.2.152.dev0.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|
|
File without changes
|