docling-project / docling-project/docling

Convert raising 'xlsx' type is not supported.

Open
#1,037 3 comments 0 reactions 1 assignee Claimed by @ceberam View on GitHub
bug mimetype
Dominant language
Python
Stars
66.4k
Forks
4.8k
Avg merge
2d 21h
Merged PRs (30d)
84

Description

### Bug
The `_guess_format` method in `_DocumentConversionInput` class is incorrectly identifying XLSX files as "application/zip" format.

### Steps to Reproduce
1. Create an instance of DoclingConvert with XLSX support:
```py
converter = DoclingConvert(allowed_formats=[InputFormat.XLSX])
result = converter.convert(path)
result.document.save_as_markdown(Path("./output.md"))
```
The _guess_format method in _DocumentConversionInput is returning "application/zip"

```py
class _DocumentConversionInput):
def _guess_format(self, obj: Path | DocumentStream) -> InputFormat | None: ...
```

Inside the `_guess_format` `filetype.guess_mime` is returning `application/zip`.
...

### Docling version
ocling version: 2.24.0
Docling Core version: 2.20.0
Docling IBM Models version: 3.4.0
Docling Parse version: 3.4.0
Python: cpython-312 (3.12.8)
Platform: Linux-6.6.75-2-MANJARO-x86_64-with-glibc2.41
...

### Python version
Python 3.12.8
...

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.