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

Function detect_from_filename

magic/compat.py:259–266  ·  view source on GitHub ↗

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

(filename)

Source from the content-addressed store, hash-verified

257
258
259def detect_from_filename(filename):
260 '''Detect mime type, encoding and file type from a filename
261
262 Returns a `FileMagic` namedtuple.
263 '''
264
265 return _create_filemagic(mime_magic.file(filename),
266 none_magic.file(filename))
267
268
269def detect_from_fobj(fobj):

Callers

nothing calls this directly

Calls 2

_create_filemagicFunction · 0.85
fileMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…