API reference
Uses magic to determine the mimetype of a file on disk or in memory.
Supports both libmagic’s Python bindings and the python-magic package.
data (bytes | bytearray | str) – The file data, either as in-memory bytes or a path to the file as a string.
The mime type as a string.
str