Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | 07-Feb-2023 | - | ||||
file_magic/ | H | 25-Sep-2022 | - | 2 | 1 | |
CHANGELOG.md | H A D | 25-Sep-2022 | 495 | 22 | 13 | |
HOWTO | H A D | 25-Sep-2022 | 155 | 8 | 7 | |
LICENSE | H A D | 08-May-2022 | 1.4 KiB | 26 | 23 | |
Makefile.am | H A D | 25-Sep-2022 | 110 | 5 | 2 | |
Makefile.in | H A D | 25-Sep-2022 | 12.1 KiB | 449 | 382 | |
README.md | H A D | 08-May-2022 | 584 | 32 | 18 | |
example.py | H A D | 08-May-2022 | 207 | 18 | 11 | |
magic.py | H A D | 25-Sep-2022 | 10.4 KiB | 362 | 287 | |
magic.pyi | H A D | 25-Sep-2022 | 2.3 KiB | 94 | 87 | |
pyproject.toml | H A D | 25-Sep-2022 | 720 | 32 | 26 | |
setup.py | H A D | 08-May-2022 | 824 | 28 | 21 | |
tests.py | H A D | 25-Sep-2022 | 983 | 33 | 22 | |
threads.py | H A D | 25-Sep-2022 | 497 | 25 | 16 |
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