From 1ebbd027274333758fc3517685d81847601db676 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 15 Apr 2024 19:00:10 +0200 Subject: Adding upstream version 1:5.45. Signed-off-by: Daniel Baumann --- python/README.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 python/README.md (limited to 'python/README.md') 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 -- cgit v1.2.3