From ae93668bac8dc1bb5c666736eeed410f650aae60 Mon Sep 17 00:00:00 2001 From: Kai Date: Fri, 7 May 2021 07:54:55 +0200 Subject: [PATCH] xlrd does not support xsls files anymore --- tsvtools/cli.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tsvtools/cli.py b/tsvtools/cli.py index 9fcc215..146c654 100644 --- a/tsvtools/cli.py +++ b/tsvtools/cli.py @@ -267,7 +267,11 @@ def find_entities(tsv_file, tsv_out_file, ner_rest_endpoint, ned_rest_endpoint, "\n\ndefault: NERD.") def make_page2tsv_commands(xls_file, directory, purpose): if xls_file is not None: - df = pd.read_excel(xls_file) + + if xls_file.endswith(".xls"): + df = pd.read_excel(xls_file) + else: + df = pd.read_excel(xls_file, engine='openpyxl') for _, row in df.iterrows(): print('page2tsv $(OPTIONS) {}.xml {}.tsv --image-url={} --scale-factor={} --purpose={}'.