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.

Source Distribution

file-magic-0.4.0.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

file_magic-0.4.0-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file file-magic-0.4.0.tar.gz.

File metadata

  • Download URL: file-magic-0.4.0.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for file-magic-0.4.0.tar.gz
Algorithm Hash digest
SHA256 4dd1492b9a9ca57c272aaa9cc495cd65310115b2aec5503c7d047ad9bfae1035
MD5 f45a8e8c65501a222bec449fd14c2059
BLAKE2b-256 bce5818e16cc2100898a5ab313e6a468a04390e6157fed539c98deab40015454

See more details on using hashes here.

File details

Details for the file file_magic-0.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for file_magic-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8ea03da58cf4de5a69909c0e27746cf17fc903356a601967ab01577916a73aed
MD5 4f6d577179b4762c1f7aa50a76ab18bb
BLAKE2b-256 bb7eb256e53a6558afd348387c3119dc4a1e3003d36030584a427168c8d72a7a

See more details on using hashes here.

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