trame.assets.mimetypes module

trame.assets.mimetypes.add_mimetype_override(type, ext)

Add a mimetype both now and when mimetypes.init() is called.

Parameters:
  • type (str) – mimetype

  • ext (str) – file extension for which the mimetype applies

trame.assets.mimetypes.to_mime(file_path)

Return the mime type from a given path

Parameters:

file_path (str) – Path to analyse

Returns:

Mime type

Return type:

str