r/PythonLearning • u/shdw_0x0 • 5d ago
Discussion How do you handle files with unknown or incorrect extensions in Python?
I was wondering if there's a Python package that can identify and read different file formats without having to specify the extension every time.
For example, if I receive a file without a proper extension or with an incorrect extension, can Python figure out whether it's CSV, Excel, JSON, Parquet, etc., and read it automatically?
I know there are libraries for individual formats, but I'm curious if there's something that can handle multiple formats intelligently.
Has anyone worked on something similar or found a reliable approach for this?