• Home
  • History
  • Annotate
  • only in this directory
NameDateSize

..22-Jun-202131

CHANGELOG.mdH A D22-Jun-2021402

example.pyH A D22-Jun-2021207

LICENSEH A D22-Jun-20211.4 KiB

magic.pyH A D22-Jun-20218.2 KiB

Makefile.amH A D22-Jun-202187

Makefile.inH A D22-Jun-202111.9 KiB

README.mdH A D22-Jun-2021584

setup.pyH A D22-Jun-2021824

tests.pyH A D22-Jun-2021964

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