gws.lib.mime

Mime types.

Source code: gws.lib.mime

Package Contents

gws.lib.mime.BIN = 'application/octet-stream'
gws.lib.mime.CSS = 'text/css'
gws.lib.mime.CSV = 'text/csv'
gws.lib.mime.DOC = 'application/msword'
gws.lib.mime.extension_for(mt: str) str | None

Returns the extension of a given mime type.

Parameters:

mt – Mime type.

Returns:

The mime type extension.

gws.lib.mime.for_path(path: str) str

Returns the mime type for a given path.

Parameters:

path – Path to mime type.

Returns:

The mime type or BIN if type is unknown.

gws.lib.mime.GEOJSON = 'application/geojson'
gws.lib.mime.get(mt: str) str | None

Return the normalized mime type.

Parameters:

mt – Mime type or content type.

Returns:

The normalized mime type.

gws.lib.mime.GIF = 'image/gif'
gws.lib.mime.GML = 'application/gml+xml'
gws.lib.mime.GML2 = 'application/gml+xml;version=2'
gws.lib.mime.GML3 = 'application/gml+xml;version=3'
gws.lib.mime.GZIP = 'application/gzip'
gws.lib.mime.HTML = 'text/html'
gws.lib.mime.JPEG = 'image/jpeg'
gws.lib.mime.JS = 'application/javascript'
gws.lib.mime.JSON = 'application/json'
gws.lib.mime.PDF = 'application/pdf'
gws.lib.mime.PNG = 'image/png'
gws.lib.mime.PPT = 'application/vnd.ms-powerpoint'
gws.lib.mime.SVG = 'image/svg+xml'
gws.lib.mime.TTF = 'application/x-font-ttf'
gws.lib.mime.TXT = 'text/plain'
gws.lib.mime.WEBP = 'image/webp'
gws.lib.mime.XLS = 'application/vnd.ms-excel'
gws.lib.mime.XML = 'application/xml'
gws.lib.mime.ZIP = 'application/zip'