Name Date Size #Lines LOC

..--

file_magic/H05-Sep-2024-21

CHANGELOG.mdHD05-Sep-2024495 2213

LICENSEHD05-Sep-20241.4 KiB2623

Makefile.amHD05-Sep-2024110 52

Makefile.inHD07-Feb-202512.1 KiB450383

README.mdHD05-Sep-2024584 3218

example.pyHD05-Sep-2024207 1811

magic.pyHD05-Sep-202410.4 KiB362287

setup.pyHD05-Sep-2024824 2821

tests.pyHD05-Sep-2024983 3322

README.md

1# `file-magic`: Python Bindings
2
3This library is a Python ctypes interface to `libmagic`.
4
5
6## Installing
7
8You can install `file-magic` either with:
9
10    python setup.py install
11    # or
12    easy_install .
13    # or
14    pip install file-magic
15
16
17## Using
18
19    import magic
20
21    detected = magic.detect_from_filename('magic.py')
22    print 'Detected MIME type: {}'.format(detected.mime_type)
23    print 'Detected encoding: {}'.format(detected.encoding)
24    print 'Detected file type name: {}'.format(detected.name)
25
26
27## Developing/Contributing
28
29To run the tests:
30
31    python setup.py test
32