Skip to main content

Guess a files type from its content and extension

Project description

File Type Guesser

Test PyPI PyPI - Python Version PyPI - Downloads License MIT Open Issues Line Count Last Commit

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

file-type-guesser-0.2.0.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

file_type_guesser-0.2.0-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

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

Hashes for file-type-guesser-0.2.0.tar.gz
Algorithm Hash digest
SHA256 bcc88f62d615afe5423915c23bdae9662371d52c4af626964413bc9ad5659ff5
MD5 d1fede7b572979d16d15bb6552a9a6d6
BLAKE2b-256 1c6f9b6653877e6023d1611584a81b4424c30ce072575ca37aa4c0976d114836

See more details on using hashes here.

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

Hashes for file_type_guesser-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7659be8196aea8da002e0001e570e43a4a7275a1fbe32e35217f0164cee99882
MD5 59d2be403efeb4a02f81c27a3e1e681b
BLAKE2b-256 4e26472ade76b6ec1a0971a7674d17862176b60484d7aad9e3fa91f5f1b27bda

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page