diff options
Diffstat (limited to '.venv/lib/python3.12/site-packages/filetype-1.2.0.dist-info')
8 files changed, 287 insertions, 0 deletions
diff --git a/.venv/lib/python3.12/site-packages/filetype-1.2.0.dist-info/INSTALLER b/.venv/lib/python3.12/site-packages/filetype-1.2.0.dist-info/INSTALLER new file mode 100644 index 00000000..a1b589e3 --- /dev/null +++ b/.venv/lib/python3.12/site-packages/filetype-1.2.0.dist-info/INSTALLER @@ -0,0 +1 @@ +pip diff --git a/.venv/lib/python3.12/site-packages/filetype-1.2.0.dist-info/LICENSE b/.venv/lib/python3.12/site-packages/filetype-1.2.0.dist-info/LICENSE new file mode 100644 index 00000000..d5dbb7e3 --- /dev/null +++ b/.venv/lib/python3.12/site-packages/filetype-1.2.0.dist-info/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 Tomás Aparicio + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/.venv/lib/python3.12/site-packages/filetype-1.2.0.dist-info/METADATA b/.venv/lib/python3.12/site-packages/filetype-1.2.0.dist-info/METADATA new file mode 100644 index 00000000..287a97a2 --- /dev/null +++ b/.venv/lib/python3.12/site-packages/filetype-1.2.0.dist-info/METADATA @@ -0,0 +1,213 @@ +Metadata-Version: 2.1 +Name: filetype +Version: 1.2.0 +Summary: Infer file type and MIME type of any file/buffer. No external dependencies. +Home-page: https://github.com/h2non/filetype.py +Author: Tomas Aparicio +Author-email: tomas@aparicio.me +License: MIT +Download-URL: https://github.com/h2non/filetype.py/tarball/master +Keywords: file libmagic magic infer numbers magicnumbers discovery mime type kind +Platform: any +Classifier: Development Status :: 5 - Production/Stable +Classifier: Environment :: Console +Classifier: Environment :: Web Environment +Classifier: Intended Audience :: Developers +Classifier: Intended Audience :: System Administrators +Classifier: License :: OSI Approved :: MIT License +Classifier: Operating System :: OS Independent +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3.5 +Classifier: Programming Language :: Python :: 3.6 +Classifier: Programming Language :: Python :: 3.7 +Classifier: Programming Language :: Python :: 3.8 +Classifier: Programming Language :: Python :: 3.9 +Classifier: Topic :: System +Classifier: Topic :: System :: Filesystems +Classifier: Topic :: Utilities + +filetype.py |Build Status| |PyPI| |Pyversions| |API| +==================================================== + +Small and dependency free `Python`_ package to infer file type and MIME +type checking the `magic numbers`_ signature of a file or buffer. + +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 + +Installation +------------ + +:: + + pip install filetype + +API +--- + +See `annotated API reference`_. + +Examples +-------- + +Simple file type checking +^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. code-block:: python + + import filetype + + def main(): + kind = filetype.guess('tests/fixtures/sample.jpg') + if kind is None: + print('Cannot guess file type!') + return + + print('File extension: %s' % kind.extension) + print('File MIME type: %s' % kind.mime) + + if __name__ == '__main__': + main() + +Supported types +--------------- + +Image +^^^^^ + +- **dwg** - ``image/vnd.dwg`` +- **xcf** - ``image/x-xcf`` +- **jpg** - ``image/jpeg`` +- **jpx** - ``image/jpx`` +- **png** - ``image/png`` +- **apng** - ``image/apng`` +- **gif** - ``image/gif`` +- **webp** - ``image/webp`` +- **cr2** - ``image/x-canon-cr2`` +- **tif** - ``image/tiff`` +- **bmp** - ``image/bmp`` +- **jxr** - ``image/vnd.ms-photo`` +- **psd** - ``image/vnd.adobe.photoshop`` +- **ico** - ``image/x-icon`` +- **heic** - ``image/heic`` +- **avif** - ``image/avif`` + +Video +^^^^^ + +- **3gp** - ``video/3gpp`` +- **mp4** - ``video/mp4`` +- **m4v** - ``video/x-m4v`` +- **mkv** - ``video/x-matroska`` +- **webm** - ``video/webm`` +- **mov** - ``video/quicktime`` +- **avi** - ``video/x-msvideo`` +- **wmv** - ``video/x-ms-wmv`` +- **mpg** - ``video/mpeg`` +- **flv** - ``video/x-flv`` + +Audio +^^^^^ + +- **aac** - ``audio/aac`` +- **mid** - ``audio/midi`` +- **mp3** - ``audio/mpeg`` +- **m4a** - ``audio/mp4`` +- **ogg** - ``audio/ogg`` +- **flac** - ``audio/x-flac`` +- **wav** - ``audio/x-wav`` +- **amr** - ``audio/amr`` +- **aiff** - ``audio/x-aiff`` + +Archive +^^^^^^^ + +- **br** - ``application/x-brotli`` +- **rpm** - ``application/x-rpm`` +- **dcm** - ``application/dicom`` +- **epub** - ``application/epub+zip`` +- **zip** - ``application/zip`` +- **tar** - ``application/x-tar`` +- **rar** - ``application/x-rar-compressed`` +- **gz** - ``application/gzip`` +- **bz2** - ``application/x-bzip2`` +- **7z** - ``application/x-7z-compressed`` +- **xz** - ``application/x-xz`` +- **pdf** - ``application/pdf`` +- **exe** - ``application/x-msdownload`` +- **swf** - ``application/x-shockwave-flash`` +- **rtf** - ``application/rtf`` +- **eot** - ``application/octet-stream`` +- **ps** - ``application/postscript`` +- **sqlite** - ``application/x-sqlite3`` +- **nes** - ``application/x-nintendo-nes-rom`` +- **crx** - ``application/x-google-chrome-extension`` +- **cab** - ``application/vnd.ms-cab-compressed`` +- **deb** - ``application/x-deb`` +- **ar** - ``application/x-unix-archive`` +- **Z** - ``application/x-compress`` +- **lzo** - ``application/x-lzop`` +- **lz** - ``application/x-lzip`` +- **lz4** - ``application/x-lz4`` +- **zstd** - ``application/zstd`` + +Document +^^^^^^^^ + +- **doc** - ``application/msword`` +- **docx** - ``application/vnd.openxmlformats-officedocument.wordprocessingml.document`` +- **odt** - ``application/vnd.oasis.opendocument.text`` +- **xls** - ``application/vnd.ms-excel`` +- **xlsx** - ``application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`` +- **ods** - ``application/vnd.oasis.opendocument.spreadsheet`` +- **ppt** - ``application/vnd.ms-powerpoint`` +- **pptx** - ``application/vnd.openxmlformats-officedocument.presentationml.presentation`` +- **odp** - ``application/vnd.oasis.opendocument.presentation`` + +Font +^^^^ + +- **woff** - ``application/font-woff`` +- **woff2** - ``application/font-woff`` +- **ttf** - ``application/font-sfnt`` +- **otf** - ``application/font-sfnt`` + +Application +^^^^^^^^^^^ + +- **wasm** - ``application/wasm`` + +.. _Python: http://python.org +.. _magic numbers: https://en.wikipedia.org/wiki/Magic_number_(programming)#Magic_numbers_in_files +.. _filetype: https://github.com/h2non/filetype +.. _wide range: #supported-types +.. _Pluggable: #add-additional-file-type-matchers +.. _Fast: #benchmarks +.. _pass a list of bytes: #file-header +.. _annotated API reference: https://h2non.github.io/filetype.py/ + +.. |Build Status| image:: https://travis-ci.org/h2non/filetype.py.svg?branch=master + :target: https://travis-ci.org/h2non/filetype.py +.. |PyPI| image:: https://img.shields.io/pypi/v/filetype.svg?maxAge=2592000?style=flat-square + :target: https://pypi.python.org/pypi/filetype +.. |Pyversions| image:: https://img.shields.io/pypi/pyversions/filetype.svg?style=flat-square + :target: https://pypi.python.org/pypi/filetype +.. |API| image:: https://img.shields.io/badge/api-docs-green.svg + :target: https://h2non.github.io/filetype.py + + diff --git a/.venv/lib/python3.12/site-packages/filetype-1.2.0.dist-info/RECORD b/.venv/lib/python3.12/site-packages/filetype-1.2.0.dist-info/RECORD new file mode 100644 index 00000000..6c6a50d3 --- /dev/null +++ b/.venv/lib/python3.12/site-packages/filetype-1.2.0.dist-info/RECORD @@ -0,0 +1,41 @@ +../../../bin/filetype,sha256=Ub2aukH45fw7S-oB0PHEbghWqzCF3gkNOOYrCssMki0,252
+filetype-1.2.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
+filetype-1.2.0.dist-info/LICENSE,sha256=jkTiqjWzcb3MhWvPDSRCpBDdVf3maw38L83wdtl5Rqw,1082
+filetype-1.2.0.dist-info/METADATA,sha256=MPLH6RLq9ns07GM7qWCYU3h-oeJfoTHx9YW8BmH6v1E,6512
+filetype-1.2.0.dist-info/RECORD,,
+filetype-1.2.0.dist-info/WHEEL,sha256=ADKeyaGyKF5DwBNE0sRE5pvW-bSkFMJfBuhzZ3rceP4,110
+filetype-1.2.0.dist-info/entry_points.txt,sha256=Zek5WP3znYaTL7Rwzo0gdSFP-mr2fRR2XvwAA773YDY,53
+filetype-1.2.0.dist-info/top_level.txt,sha256=9E4F1bIRPoq5TGtC-BHwM1_svcsWYRiC0N_qAGrlW0Y,9
+filetype-1.2.0.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
+filetype/__init__.py,sha256=7c1C2XIbB7md1oI-0nwBzxoD52he_7NYry3YQV5OXa8,223
+filetype/__main__.py,sha256=4-2VK-0hB2mLL_HukB8cOa0jsQKLq95gG4UhCPqF0rg,803
+filetype/__pycache__/__init__.cpython-312.pyc,,
+filetype/__pycache__/__main__.cpython-312.pyc,,
+filetype/__pycache__/filetype.cpython-312.pyc,,
+filetype/__pycache__/helpers.cpython-312.pyc,,
+filetype/__pycache__/match.cpython-312.pyc,,
+filetype/__pycache__/utils.cpython-312.pyc,,
+filetype/filetype.py,sha256=SBYUBugfBQSO9z7zyWaXOak6UpLUlmZZ--5FpN0fybM,2122
+filetype/helpers.py,sha256=O0hofWlmG8J_X81IuQ8KszvjgnUb-O6BzO-wUJRTLV0,2947
+filetype/match.py,sha256=XUHst4XDmYlJtfYAMlGuySl2IWia2UoCb8NIDYiCRgI,3288
+filetype/types/__init__.py,sha256=baH8xCYyatykxtCUccgGGIwNdit6x5jGsXxWTvpo4t8,2085
+filetype/types/__pycache__/__init__.cpython-312.pyc,,
+filetype/types/__pycache__/application.cpython-312.pyc,,
+filetype/types/__pycache__/archive.cpython-312.pyc,,
+filetype/types/__pycache__/audio.cpython-312.pyc,,
+filetype/types/__pycache__/base.cpython-312.pyc,,
+filetype/types/__pycache__/document.cpython-312.pyc,,
+filetype/types/__pycache__/font.cpython-312.pyc,,
+filetype/types/__pycache__/image.cpython-312.pyc,,
+filetype/types/__pycache__/isobmff.cpython-312.pyc,,
+filetype/types/__pycache__/video.cpython-312.pyc,,
+filetype/types/application.py,sha256=6Knc4Y38GbfuoSjdPl29vIsusjNIPjLWVk22nxCnS9I,498
+filetype/types/archive.py,sha256=kZWEHJmJ1NmQT0Hm-JmEHI1TXg5NrzxJ4YCbfV-6y8c,17006
+filetype/types/audio.py,sha256=oOAS-cdA175rELcK_17w-gylJkmSh8FTrAoVAOwsfUA,4960
+filetype/types/base.py,sha256=dvvqVjuSqwtbh2qyP7QnmeWUWUsfrHwJ_rOEgJmDQZ8,647
+filetype/types/document.py,sha256=mxOhuymNIpsqMWCgy-Fm8vkSgDoSeCXYADxmO1JPx6Q,7513
+filetype/types/font.py,sha256=nP5Ey-EcKMU4phGYtIlQ08I5cecWnr5vzDLVbiPOiyY,2924
+filetype/types/image.py,sha256=r8pINANPJZbCEmZKn8F74fFffk4INtDin_GtQtQImZs,9130
+filetype/types/isobmff.py,sha256=zLXCbTET6wp_9yq8jE3bhBRTaCdSAKma5ElyHVGd2Sk,958
+filetype/types/video.py,sha256=DfkFd5ofnEK25r_n71LxjX3nAAgO8xJ7Op_lL9uEbNc,5371
+filetype/utils.py,sha256=sjZCMfYawZ6RWN1Dr3jDmsqIjLSEBFubNgi8HROjaPQ,2089
diff --git a/.venv/lib/python3.12/site-packages/filetype-1.2.0.dist-info/WHEEL b/.venv/lib/python3.12/site-packages/filetype-1.2.0.dist-info/WHEEL new file mode 100644 index 00000000..6d38aa06 --- /dev/null +++ b/.venv/lib/python3.12/site-packages/filetype-1.2.0.dist-info/WHEEL @@ -0,0 +1,6 @@ +Wheel-Version: 1.0 +Generator: bdist_wheel (0.35.1) +Root-Is-Purelib: true +Tag: py2-none-any +Tag: py3-none-any + diff --git a/.venv/lib/python3.12/site-packages/filetype-1.2.0.dist-info/entry_points.txt b/.venv/lib/python3.12/site-packages/filetype-1.2.0.dist-info/entry_points.txt new file mode 100644 index 00000000..2909098f --- /dev/null +++ b/.venv/lib/python3.12/site-packages/filetype-1.2.0.dist-info/entry_points.txt @@ -0,0 +1,3 @@ +[console_scripts] +filetype = filetype.__main__:main + diff --git a/.venv/lib/python3.12/site-packages/filetype-1.2.0.dist-info/top_level.txt b/.venv/lib/python3.12/site-packages/filetype-1.2.0.dist-info/top_level.txt new file mode 100644 index 00000000..fb14e2f6 --- /dev/null +++ b/.venv/lib/python3.12/site-packages/filetype-1.2.0.dist-info/top_level.txt @@ -0,0 +1 @@ +filetype diff --git a/.venv/lib/python3.12/site-packages/filetype-1.2.0.dist-info/zip-safe b/.venv/lib/python3.12/site-packages/filetype-1.2.0.dist-info/zip-safe new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/.venv/lib/python3.12/site-packages/filetype-1.2.0.dist-info/zip-safe @@ -0,0 +1 @@ + |