mirror of
https://github.com/qurator-spk/modstool.git
synced 2025-06-08 11:20:07 +02:00
Merge branch 'master' of https://github.com/qurator-spk/modstool
This commit is contained in:
commit
2ff15f3497
2 changed files with 6 additions and 1 deletions
|
@ -451,7 +451,8 @@ def flatten(d: MutableMapping, parent='', separator='_'):
|
|||
@click.option('--output', '-o', 'output_file', type=click.Path(), help='Output pickle file',
|
||||
default='mods_info_df.pkl', show_default=True)
|
||||
@click.option('--output-csv', type=click.Path(), help='Output CSV file')
|
||||
def process(mets_files: List[str], output_file: str, output_csv: str):
|
||||
@click.option('--output-xlsx', type=click.Path(), help='Output Excel .xlsx file')
|
||||
def process(mets_files: List[str], output_file: str, output_csv: str, output_xlsx: str):
|
||||
"""
|
||||
A tool to convert the MODS metadata in INPUT to a pandas DataFrame.
|
||||
|
||||
|
@ -521,6 +522,9 @@ def process(mets_files: List[str], output_file: str, output_csv: str):
|
|||
if output_csv:
|
||||
logging.info('Writing CSV to {}'.format(output_csv))
|
||||
mods_info_df.to_csv(output_csv)
|
||||
if output_xlsx:
|
||||
logging.info('Writing Excel .xlsx to {}'.format(output_xlsx))
|
||||
mods_info_df.to_excel(output_xlsx)
|
||||
|
||||
|
||||
def main():
|
||||
|
|
|
@ -2,3 +2,4 @@ click
|
|||
pandas ~= 1.0.5
|
||||
tqdm
|
||||
lxml
|
||||
openpyxl
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue