diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 09:52:51 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 09:52:51 +0000 |
commit | 71507ca5d2410b11889ca963fafcd1bcad5044c3 (patch) | |
tree | 17e6d07243d49e29e4b75887e0d07f24ec2b66e8 /python/README.md | |
parent | Initial commit. (diff) | |
download | file-71507ca5d2410b11889ca963fafcd1bcad5044c3.tar.xz file-71507ca5d2410b11889ca963fafcd1bcad5044c3.zip |
Adding upstream version 1:5.44.upstream/1%5.44upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | python/README.md | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/python/README.md b/python/README.md new file mode 100644 index 0000000..d626e31 --- /dev/null +++ b/python/README.md @@ -0,0 +1,31 @@ +# `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 |