Skip to main content

Python front end for libmagic(3)

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.

Source Distribution

file-magic-0.4.1.tar.gz (5.7 kB view hashes)

Uploaded Source

Built Distribution

file_magic-0.4.1-py3-none-any.whl (6.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page