libb.magic_mime_from_buffer

magic_mime_from_buffer(buffer)[source]

Detect mimetype using the magic library.

Parameters:

buffer (bytes) – Buffer from header of file.

Returns:

The detected mimetype.

Return type:

str