Bug#953523: ITP: filetype.py -- Small module to infer binary file types via signature
Package: wnpp
Severity: wishlist
Owner: Joao Eriberto Mota Filho <eriberto@debian.org>
* Package name : filetype.py
Version : 1.0.5
Upstream Author : Tomás Aparicio <tomas@aparicio.me>
* URL : https://github.com/h2non/filetype.py
* License : MIT
Programming Lang: Python 3
Description : Small module to infer binary file types via signature
Small and dependency free Python module to infer file type and MIME type
checking the magic numbers signature of a file or buffer (aka file pattern).
.
This is a Python port from filetype Go package.
.
Features:
- Simple and friendly API.
- Supports a wide range of file types.
- Provides file extension and MIME type inference.
- File discovery by extension or MIME type.
- File discovery by kind (image, video, audio...).
- Pluggable: add new custom type matchers.
- Fast, even processing large files.
- Only first 261 bytes representing the max file header is required, so you
can just pass a list of bytes.
- Dependency free (just Python code, no C extensions, no libmagic bindings).
- Cross-platform file recognition.
.
Currently, the following patterns are recognised:
- Image: bmp, cr2, gif, heic, ico, jpg, jpx, jxr, png, psd, tif, webp.
- Video: avi, flv, m4v, mkv, mov, mp4, mpg, webm, wmv.
- Audio: amr, flac, m4a, mid, mp3, ogg, wav.
- Archive: Z, ar, bz2, cab, crx, deb, eot, epub, exe, gz, lz, nes, pdf, ps,
rar, rtf, sqlite, swf, tar, xz, zip, 7z.
- Font: otf, ttf, woff, woff2.
Reply to: