diff options
| author | Eitan Adler <eadler@FreeBSD.org> | 2018-07-29 05:53:49 +0000 |
|---|---|---|
| committer | Eitan Adler <eadler@FreeBSD.org> | 2018-07-29 05:53:49 +0000 |
| commit | ad1ba6e1e032f79d03b9a6e2c714de84d1911b3a (patch) | |
| tree | 24e9595e175209972236019508c9ac6b34ec83b9 /python/README.md | |
| parent | fd86496b2232c1f79946dc2d21515012a33b6274 (diff) | |
Notes
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 000000000000..d626e31882aa --- /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 |
