From 939967edc8863d7781d2311631cab3e94c3fc1c3 Mon Sep 17 00:00:00 2001 From: Mike Gerber Date: Wed, 27 Nov 2024 19:05:05 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20De-couple=20mods=5Finfo=20from?= =?UTF-8?q?=20page=5Finfo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/mods4pandas/mods4pandas.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mods4pandas/mods4pandas.py b/src/mods4pandas/mods4pandas.py index c3cde97..e08fe37 100755 --- a/src/mods4pandas/mods4pandas.py +++ b/src/mods4pandas/mods4pandas.py @@ -436,13 +436,13 @@ def process(mets_files: List[str], output_file: str, output_page_info: str): # "meta" d['mets_file'] = mets_file - # METS - per-page - if output_page_info: - page_info_doc: list[dict] = pages_to_dict(mets, raise_errors=True) - + # Save insert_into_db(con, "mods_info", d) con.commit() + + # METS - per-page if output_page_info: + page_info_doc: list[dict] = pages_to_dict(mets, raise_errors=True) insert_into_db_multiple(con_page_info, "page_info", page_info_doc) con_page_info.commit()