Python Mimetypes Module
MIME type guessing — guess_type, guess_extension, init. This category documents 5 Python mimetypes module entries, and each page gives you the full syntax, the parameter list, the return value, and a runnable example. The entries include: mimetypes.guess_type(), mimetypes.guess_extension(), mimetypes.init(), mimetypes.MimeTypes(), mimetypes.read_windows_registry(). mimetypes.guess_type() guesses the MIME type and encoding of a file from its URL/extension. mimetypes.guess_extension() guesses the file extension for a given MIME type. mimetypes.init() initializes the MIME type database from system files. mimetypes.MimeTypes() creates a MIME types registry with optional custom mappings. mimetypes.read_windows_registry() loads MIME types from Windows registry (Windows only). Mimetypes Module belongs to the File & Data group alongside Pathlib Module, Shutil Module, Glob Module, Fileinput Module. You can also search across every category from the search page, browse the complete A–Z index, or try any example in the Python playground.