MCPcopy Create free account
hub / github.com/ahupp/python-magic / detect_from_content

Function detect_from_content

magic/compat.py:280–287  ·  view source on GitHub ↗

Detect mime type, encoding and file type from bytes Returns a `FileMagic` namedtuple.

(byte_content)

Source from the content-addressed store, hash-verified

278
279
280def detect_from_content(byte_content):
281 '''Detect mime type, encoding and file type from bytes
282
283 Returns a `FileMagic` namedtuple.
284 '''
285
286 return _create_filemagic(mime_magic.buffer(byte_content),
287 none_magic.buffer(byte_content))

Callers

nothing calls this directly

Calls 2

_create_filemagicFunction · 0.85
bufferMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…