Guess a files type from its content and extension
Project description
File Type Guesser
Guess a file's type from its content and extension.
This is intended to be a pure Python implementation of something like python-magic. This means it should work on all platforms that can run Python as it does not require external binaries like libmagic.
This project currently is not heavily tested and not fully feature complete
Example Of Use
from pathlib import Path
from file_type_guesser import guess_file
path = Path("README.md")
guess = guess_file(path)
print(guess)
ContentGuess(category=<FileTypes.TEXT: 1>, extention='md', content_ext='md')
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file file-type-guesser-0.2.0.tar.gz
.
File metadata
- Download URL: file-type-guesser-0.2.0.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bcc88f62d615afe5423915c23bdae9662371d52c4af626964413bc9ad5659ff5 |
|
MD5 | d1fede7b572979d16d15bb6552a9a6d6 |
|
BLAKE2b-256 | 1c6f9b6653877e6023d1611584a81b4424c30ce072575ca37aa4c0976d114836 |
File details
Details for the file file_type_guesser-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: file_type_guesser-0.2.0-py3-none-any.whl
- Upload date:
- Size: 6.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7659be8196aea8da002e0001e570e43a4a7275a1fbe32e35217f0164cee99882 |
|
MD5 | 59d2be403efeb4a02f81c27a3e1e681b |
|
BLAKE2b-256 | 4e26472ade76b6ec1a0971a7674d17862176b60484d7aad9e3fa91f5f1b27bda |