From 492680f4681b82370ce984d7481015b353cd0d4b Mon Sep 17 00:00:00 2001 From: Michele Dolfi Date: Mon, 14 Apr 2025 07:04:33 +0200 Subject: [PATCH] apply styling Signed-off-by: Michele Dolfi --- docling/datamodel/document.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/docling/datamodel/document.py b/docling/datamodel/document.py index fcc37484..70d08b75 100644 --- a/docling/datamodel/document.py +++ b/docling/datamodel/document.py @@ -283,9 +283,14 @@ class _DocumentConversionInput(BaseModel): if mime is None: # must guess from with obj.open("rb") as f: content = f.read(1024) # Read first 1KB - if mime is not None and mime.lower() == "application/zip" and obj.suffixes[-1].lower() == ".xlsx": - mime = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" - + if ( + mime is not None + and mime.lower() == "application/zip" + and obj.suffixes[-1].lower() == ".xlsx" + ): + mime = ( + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" + ) elif isinstance(obj, DocumentStream): content = obj.stream.read(8192)