python-magic #4674
python-magic
#4674
-
Beta Was this translation helpful? Give feedback.
Answered by
ndonkoHenri
Jun 17, 2026
Replies: 1 comment
-
|
The native libmagic library and its magic database are bundled automatically (via import magic
magic.from_buffer(data) # 'PNG image data, ...'
magic.from_buffer(data, mime=True) # 'image/png'
magic.from_file("photo.png") |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
ndonkoHenri
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
python-magicis now available for Flet mobile apps (iOS and Android): https://pypi.flet.dev/python-magicThe native libmagic library and its magic database are bundled automatically (via
flet-libmagic), so file-type / MIME detection works on-device with no extra setup: