diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 17:00:10 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 17:00:10 +0000 |
commit | 1ebbd027274333758fc3517685d81847601db676 (patch) | |
tree | 5259d053d3e3066e0745150805fa4b20184eef98 /python/README.md | |
parent | Initial commit. (diff) | |
download | file-upstream.tar.xz file-upstream.zip |
Adding upstream version 1:5.45.upstream/1%5.45upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'python/README.md')
-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 |