Opening files with no extension
Hi,
I have a use case where I read tabular files that have no extension and then analyze their content. They can be csv, xlsx, xls or ods (as of now). I first use python-magic
to detect what kind of format a file is in, and then process it.
For csv, ods and xls, pandas
(and utils libraries like xlrd
or odfpy
) have no problem opening a file that has no extension, but openpyxl
, which I first use to check the sheets of a file (openpyxl.load_workbook
) that has been recognized as Excel, wants to have a valid extension (here).
Would you consider allowing users to bypass this check (maybe with an additionnal argument)? This could bring more coherence to the whole "reading tabular files with pandas
and related libs" process, also considering that
pandas.read_excel(an_xlsx_file_with_no_ext, engine='openpyxl')
works successfully. For now, I will work around this issue with io.BytesIO
to be able to load these files anyway.
Thanks for your consideration!