datamule 1.2.4__py3-none-any.whl → 1.2.5__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.
- datamule/document/document.py +16 -7
- datamule/portfolio.py +1 -5
- {datamule-1.2.4.dist-info → datamule-1.2.5.dist-info}/METADATA +1 -1
- {datamule-1.2.4.dist-info → datamule-1.2.5.dist-info}/RECORD +6 -6
- {datamule-1.2.4.dist-info → datamule-1.2.5.dist-info}/WHEEL +0 -0
- {datamule-1.2.4.dist-info → datamule-1.2.5.dist-info}/top_level.txt +0 -0
datamule/document/document.py
CHANGED
@@ -147,21 +147,30 @@ class Document:
|
|
147
147
|
return process_tabular_data(self)
|
148
148
|
|
149
149
|
|
150
|
-
def write_csv(self, output_folder
|
150
|
+
def write_csv(self, output_folder):
|
151
|
+
output_folder = Path(output_folder)
|
152
|
+
output_folder.mkdir(exist_ok=True)
|
151
153
|
|
152
|
-
tables = self.to_tabular(
|
154
|
+
tables = self.to_tabular()
|
153
155
|
|
154
156
|
if not tables:
|
155
157
|
return
|
156
158
|
|
157
159
|
for table in tables:
|
158
160
|
fieldnames = table.columns
|
159
|
-
output_filename =
|
161
|
+
output_filename = output_folder / f"{table.type}.csv"
|
162
|
+
|
163
|
+
# Check if the file already exists
|
164
|
+
if output_filename.exists():
|
160
165
|
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
166
|
+
with open(output_filename, 'a', newline='') as csvfile:
|
167
|
+
writer = csv.DictWriter(csvfile,fieldnames=fieldnames, quoting=csv.QUOTE_ALL)
|
168
|
+
writer.writerows(table.data)
|
169
|
+
else:
|
170
|
+
with open(output_filename, 'w', newline='') as csvfile:
|
171
|
+
writer = csv.DictWriter(csvfile, fieldnames=fieldnames, quoting=csv.QUOTE_ALL)
|
172
|
+
writer.writeheader()
|
173
|
+
writer.writerows(table.data)
|
165
174
|
|
166
175
|
|
167
176
|
def _document_to_section_text(self, document_data, parent_key=''):
|
datamule/portfolio.py
CHANGED
@@ -179,8 +179,4 @@ class Portfolio:
|
|
179
179
|
document_types = [document_types]
|
180
180
|
|
181
181
|
for submission in self.submissions:
|
182
|
-
yield from submission.document_type(document_types)
|
183
|
-
|
184
|
-
def keep(self,document_type):
|
185
|
-
for submission in self.__iter__():
|
186
|
-
submission.keep(document_type)
|
182
|
+
yield from submission.document_type(document_types)
|
@@ -3,11 +3,11 @@ datamule/config.py,sha256=Y--CVv7JcgrjJkMOSLrvm2S8B9ost6RMSkGviP-MKtg,883
|
|
3
3
|
datamule/helper.py,sha256=xgOVnea-lUlQ5I-U0vYUp0VeKPNZehNhqjJvegA3lYE,3342
|
4
4
|
datamule/index.py,sha256=0txvbzPcvY1GsdxA-wGdLzAByxSeE_1VyyBp9mZEQRM,2292
|
5
5
|
datamule/package_updater.py,sha256=Z9zaa_y0Z5cknpRn8oPea3gg4kquFHfpfhduKKCZ6NU,958
|
6
|
-
datamule/portfolio.py,sha256=
|
6
|
+
datamule/portfolio.py,sha256=zn7Ib29UU_HD4JxPiIRT3v5QgWxmPh4Q1l0VH0aJzUU,7104
|
7
7
|
datamule/sheet.py,sha256=TvFqK9eAYuVoJ2uWdAlx5EN6vS9lke-aZf7FqtUiDBc,22304
|
8
8
|
datamule/submission.py,sha256=HXuFL6snLevGk7DGlvPbjcBOJuccAIxEPXnkA1TXX8Y,8121
|
9
9
|
datamule/document/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
10
|
-
datamule/document/document.py,sha256=
|
10
|
+
datamule/document/document.py,sha256=eckqSvORnYp9KbZLTQAAjvsftATcIGtYIsFxQHI7dtQ,9859
|
11
11
|
datamule/document/processing.py,sha256=fw-1OWfbmZhG1R8XpJx_vcGwz3_djmk0FrblHAMPmwc,27476
|
12
12
|
datamule/document/table.py,sha256=Sv9jTGiVhnWIY9nHaynUUixwbCrvbLsf0fdOnFR-NCY,10791
|
13
13
|
datamule/document/mappings/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -55,7 +55,7 @@ datamule/seclibrary/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSu
|
|
55
55
|
datamule/seclibrary/bq.py,sha256=C8sb_rpXTvchprrFLcbRar4Qi0XWW25tnv1YsHSS5o4,18025
|
56
56
|
datamule/seclibrary/downloader.py,sha256=fJztJ_sEfv2oHHbDff07DRlXLmztXnzt3Yvv5YaZgGk,13718
|
57
57
|
datamule/seclibrary/query.py,sha256=qGuursTERRbOGfoDcYcpo4oWkW3PCBW6x1Qf1Puiak4,7352
|
58
|
-
datamule-1.2.
|
59
|
-
datamule-1.2.
|
60
|
-
datamule-1.2.
|
61
|
-
datamule-1.2.
|
58
|
+
datamule-1.2.5.dist-info/METADATA,sha256=7sZeCfLgGsMTOqhKrRzmCVrjn2oKnWXHcirDjoXZ-zI,512
|
59
|
+
datamule-1.2.5.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
60
|
+
datamule-1.2.5.dist-info/top_level.txt,sha256=iOfgmtSMFVyr7JGl_bYSTDry79JbmsG4p8zKq89ktKk,9
|
61
|
+
datamule-1.2.5.dist-info/RECORD,,
|
File without changes
|
File without changes
|