cdh.files.mime_names module
- cdh.files.mime_names.get_name_from_mime(mime: str, default: Optional[Union[str, callable]] = None) str [source]
Returns a human friendly name for a given MIME type. Note: the DB of mime-types is a VERY small subset of all possible types. If a MIME isn’t in the DB, this function will return the MIME (or a different default if supplied)
- Parameters
mime – a MIME which needs a human friendly name
default – either a string or a callable which is used to provide a value if the MIME is not known. A callable must accept 1 parameter (which will be the MIME as supplied).