| Up to higher level directory | |||
| Name | Date | Size | |
|---|---|---|---|
| CHANGELOG.md | 24-Sep-2022 | 495 | |
| example.py | 12-May-2011 | 207 | |
| file_magic/ | 25-Feb-2026 | ||
| LICENSE | 18-Oct-2018 | 1.4K | |
| magic.py | 24-Sep-2022 | 10.4K | |
| Makefile.am | 24-Sep-2022 | 110 | |
| Makefile.in | 18-Aug-2023 | 12.1K | |
| README.md | 18-Oct-2018 | 584 | |
| setup.py | 18-Oct-2018 | 824 | |
| tests.py | 24-Sep-2022 | 983 | |
1 # `file-magic`: Python Bindings 2 3 This library is a Python ctypes interface to `libmagic`. 4 5 6 ## Installing 7 8 You 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 29 To run the tests: 30 31 python setup.py test 32