Skip to content
Discussion options

You must be logged in to vote

python-magic is now available for Flet mobile apps (iOS and Android): https://pypi.flet.dev/python-magic

The 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:

import magic
magic.from_buffer(data)             # 'PNG image data, ...'
magic.from_buffer(data, mime=True)  # 'image/png'
magic.from_file("photo.png")

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ndonkoHenri
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants