Created
February 8, 2021 21:34
-
-
Save angeloped/f66ffde538ad4256f4bfe31089f4eccb to your computer and use it in GitHub Desktop.
Get MIME with python-magic module.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import magic | |
def getmime(filename=None): | |
return magic.Magic(mime=True).from_file(filename) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment