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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: file-magic-0.4.1.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for file-magic-0.4.1.tar.gz
Algorithm Hash digest
SHA256 a91d1483117f7ed48cd0238ad9be36b04824d57e9c38ea7523113989e81b9c53
MD5 534e6204eaaa58d944c1b5a48b784e2d
BLAKE2b-256 a3d0c6de1473a87dc74bbc694490c627d47c57b49d2f62be3c6c2871512d3c07

See more details on using hashes here.

File details

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

File metadata

  • Download URL: file_magic-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 6.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for file_magic-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cb9496a1656baf75cadd771479f63b53081095e968d0be72b9b7a7ed538e4fb8
MD5 2ff6ba9efb94459517203b3eaaebde45
BLAKE2b-256 bd13de7c05b7b64f4e41cca7385642884490e2fa704dc1e695d1429119caa9c2

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