PyDocs

Nav

Internet Data Handling

MimeTypes

  • MimeTypes(filenames=(), strict=True)
MIME-types datastore.

This datastore can handle information from mime.types-style files
and supports basic determination of MIME type from a filename or
URL, and can guess a reasonable extension given a MIME type.
Members of MimeTypes

a

add_type
Add a mapping between a type and an extension.

e

encodings_map
Dictionary mapping filename extensions to encoding types.

g

guess_all_extensions
Guess the extensions for a file based on its MIME type.
guess_extension
Guess the extension for a file based on its MIME type.
guess_file_type
Guess the type of a file based on its path.
guess_type
Guess the type of a file which is either a URL or a path-like object.

r

read
Read a single mime.types-format file, specified by pathname.
read_windows_registry
Load the MIME types database from Windows registry.
readfp
Read a single mime.types-format file.

s

suffix_map
Dictionary mapping suffixes to suffixes.

t

types_map
Tuple containing two dictionaries, mapping filename extensions to MIME types: the first dictionary is for the non-standards types and the second one is for the standard types.
types_map_inv
Tuple containing two dictionaries, mapping MIME types to a list of filename extensions: the first dictionary is for the non-standards types and the second one is for the standard types.
0 Examples
No examples for mimetypes/MimeTypes.
See Also
No see-alsos for mimetypes/MimeTypes
0 Notes
No notes for MimeTypes