mimetypes
Guess the type of a file based on the filename using mimetypes Python module
mime_guess(file)
path
string