Skip to main content

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

Metadata

Release files for file-magic 0.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for file-magic 0.4.1
File Size Uploaded
file-magic-0.4.1.tar.gz 5.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for file-magic 0.4.1
File Interpreter ABI Platform
file_magic-0.4.1-py3-none-any.whl Python 3 none any Details

Total release size: 12.0 kB

Release files / file-magic-0.4.1.tar.gz

Download URL file-magic-0.4.1.tar.gz
Size 5.7 kB
Tags Source
SHA-256 checksum
How to use checksums
a91d1483117f7ed48cd0238ad9be36b04824d57e9c38ea7523113989e81b9c53
BLAKE2b-256 checksum
How to use checksums
a3d0c6de1473a87dc74bbc694490c627d47c57b49d2f62be3c6c2871512d3c07
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.6

Release files / file_magic-0.4.1-py3-none-any.whl

Download URL file_magic-0.4.1-py3-none-any.whl
Size 6.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cb9496a1656baf75cadd771479f63b53081095e968d0be72b9b7a7ed538e4fb8
BLAKE2b-256 checksum
How to use checksums
bd13de7c05b7b64f4e41cca7385642884490e2fa704dc1e695d1429119caa9c2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.6

Release history Release notifications | RSS feed

This release

0.4.1 This release

2 release files

0.4.0

2 release files

0.3.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page