Skip to main content

(official) libmagic Python bindings

Project description

file-magic: Python Bindings

This library is a Python ctypes interface to libmagic.

Installing

You can install file-magic either with:

python setup.py install
# or
easy_install .
# or
pip install file-magic

Using

import magic

detected = magic.detect_from_filename('magic.py')
print 'Detected MIME type: {}'.format(detected.mime_type)
print 'Detected encoding: {}'.format(detected.encoding)
print 'Detected file type name: {}'.format(detected.name)

Developing/Contributing

To run the tests:

python setup.py test

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for file-magic, version 0.4.0
Filename, size File type Python version Upload date Hashes
Filename, size file_magic-0.4.0-py3-none-any.whl (3.9 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size file-magic-0.4.0.tar.gz (3.6 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page