warn-scraper 1.2.93__py3-none-any.whl → 1.2.94__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/utils.py +5 -3
- {warn_scraper-1.2.93.dist-info → warn_scraper-1.2.94.dist-info}/METADATA +1 -1
- {warn_scraper-1.2.93.dist-info → warn_scraper-1.2.94.dist-info}/RECORD +7 -7
- {warn_scraper-1.2.93.dist-info → warn_scraper-1.2.94.dist-info}/LICENSE +0 -0
- {warn_scraper-1.2.93.dist-info → warn_scraper-1.2.94.dist-info}/WHEEL +0 -0
- {warn_scraper-1.2.93.dist-info → warn_scraper-1.2.94.dist-info}/entry_points.txt +0 -0
- {warn_scraper-1.2.93.dist-info → warn_scraper-1.2.94.dist-info}/top_level.txt +0 -0
warn/utils.py
CHANGED
@@ -86,7 +86,7 @@ def save_if_good_url(filename, url, **kwargs):
|
|
86
86
|
success_flag = False
|
87
87
|
content = False
|
88
88
|
else:
|
89
|
-
with open(filename, "wb"
|
89
|
+
with open(filename, "wb") as outfile:
|
90
90
|
outfile.write(response.content)
|
91
91
|
success_flag = True
|
92
92
|
content = response.content
|
@@ -109,7 +109,9 @@ def write_rows_to_csv(output_path: Path, rows: list, mode="w"):
|
|
109
109
|
writer.writerows(rows)
|
110
110
|
|
111
111
|
|
112
|
-
def write_dict_rows_to_csv(
|
112
|
+
def write_dict_rows_to_csv(
|
113
|
+
output_path, headers, rows, mode="w", extrasaction="raise", encoding="utf-8"
|
114
|
+
):
|
113
115
|
"""Write the provided dictionary to the provided path as comma-separated values.
|
114
116
|
|
115
117
|
Args:
|
@@ -121,7 +123,7 @@ def write_dict_rows_to_csv(output_path, headers, rows, mode="w", extrasaction="r
|
|
121
123
|
"""
|
122
124
|
create_directory(output_path, is_file=True)
|
123
125
|
logger.debug(f"Writing {len(rows)} rows to {output_path}")
|
124
|
-
with open(output_path, mode, newline="") as f:
|
126
|
+
with open(output_path, mode, newline="", encoding=encoding) as f:
|
125
127
|
# Create the writer object
|
126
128
|
writer = csv.DictWriter(f, fieldnames=headers, extrasaction=extrasaction)
|
127
129
|
# If we are writing a new row ...
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: warn-scraper
|
3
|
-
Version: 1.2.
|
3
|
+
Version: 1.2.94
|
4
4
|
Summary: Command-line interface for downloading WARN Act notices of qualified plant closings and mass layoffs from state government websites
|
5
5
|
Home-page: https://github.com/biglocalnews/warn-scraper
|
6
6
|
Author: Big Local News
|
@@ -17,7 +17,7 @@ warn/__init__.py,sha256=A07JFY1TyaPtVIndBa7IvTk13DETqIkLgRdk0A-MCoE,85
|
|
17
17
|
warn/cache.py,sha256=hyta04_G-ALGwcKl4xNc7EgHS_xklyVD5d8SXNrJekY,5520
|
18
18
|
warn/cli.py,sha256=ZqyJwICdHFkn2hEgbArj_upbElR9-TSDlYDqyEGeexE,2019
|
19
19
|
warn/runner.py,sha256=oeGRybGwpnkQKlPzRMlKxhsDt1GN4PZoX-vUwrsPgos,1894
|
20
|
-
warn/utils.py,sha256=
|
20
|
+
warn/utils.py,sha256=SKwD4P2v2dlzix_zEqb98ZYe-E98Pa0xXxzUFt3rwYY,7087
|
21
21
|
warn/platforms/__init__.py,sha256=wIZRDf4tbTuC8oKM4ZrTAtwNgbtMQGzPXMwDYCFyrog,81
|
22
22
|
warn/platforms/job_center/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
23
23
|
warn/platforms/job_center/cache.py,sha256=yhA3sE46lNFg8vEewSoRYVByi0YSlkBiKm7qoSUiTdM,1868
|
@@ -65,9 +65,9 @@ warn/scrapers/va.py,sha256=O0TgNW1typgnxbkL9IbXX9WVqUALwMjBnS06t0pnkqM,7805
|
|
65
65
|
warn/scrapers/vt.py,sha256=d-bo4WK2hkrk4BhCCmLpEovcoZltlvdIUB6O0uaMx5A,1186
|
66
66
|
warn/scrapers/wa.py,sha256=UXdVtHZo_a-XfoiyOooTRfTb9W3PErSZdKca6SRORgs,4282
|
67
67
|
warn/scrapers/wi.py,sha256=ClEzXkwZbop0W4fkQgsb5oHAPUrb4luUPGV-jOKwkcg,4855
|
68
|
-
warn_scraper-1.2.
|
69
|
-
warn_scraper-1.2.
|
70
|
-
warn_scraper-1.2.
|
71
|
-
warn_scraper-1.2.
|
72
|
-
warn_scraper-1.2.
|
73
|
-
warn_scraper-1.2.
|
68
|
+
warn_scraper-1.2.94.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
69
|
+
warn_scraper-1.2.94.dist-info/METADATA,sha256=VJl78D48qBVeyOuc6aFhtI5lwIpJri1wBaqki4Iqg5A,2118
|
70
|
+
warn_scraper-1.2.94.dist-info/WHEEL,sha256=Wyh-_nZ0DJYolHNn1_hMa4lM7uDedD_RGVwbmTjyItk,91
|
71
|
+
warn_scraper-1.2.94.dist-info/entry_points.txt,sha256=poh_oSweObGlBSs1_2qZmnTodlOYD0KfO7-h7W2UQIw,47
|
72
|
+
warn_scraper-1.2.94.dist-info/top_level.txt,sha256=gOhHgNEkrUvajlzoKkVOo-TlQht9MoXnKOErjzqLGHo,11
|
73
|
+
warn_scraper-1.2.94.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|