Python - mechanism to identify compressed file type and uncompress

前端 未结 7 2072
被撕碎了的回忆
被撕碎了的回忆 2020-12-12 17:35

A compressed file can be classified into below logical groups
a. The operating system which you are working on (*ix, Win) etc.
b. Different types of compression algo

相关标签:
7条回答
  • 2020-12-12 18:14

    2019 update:
    I was looking for a solution to detect if a .csv file was gzipped or not. The answer @Lauritz gave was throwing errors for me, i imagine it's just because the way files are read has changed in the past 7 years.

    This library worked perfectly for me! https://pypi.org/project/filetype/

    0 讨论(0)
提交回复
热议问题