Skip to main content

Python implementation of dyne's file extension list

Project description

qcktypes

Python implementation of Dyne's file extension list

What is this

There I was, trying to get files out of a directory and categorize them based on their file extension. "This is probably already a module" I said. I was right, there it was, glorious filetype.

"Wait... what is a MIME bruh 😭"

I don't want to validate files actually, just tell me what they are

The module filetype validates files with their magic numbers or whatever, but I didn't want that. I found Dyne's file extension list and quickly wrote up this module since I couldn't find anything similar. I would write more features but I know literally nobody will ever use this so it's probably fine.

Rather than validating files with their magic numbers this module simply checks the extension of an input file and compares it with a dictionary of extensions and returns its category.

Installing

python3 -m pip install -U qcktypes

Quick example

import qcktypes

file =  'example.txt'
category = qcktypes.find_type(file)

print(f'{file} is in category: {category}!')

output :

$ python3 example.py
example.txt is in category: text!

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

qcktypes-1.2.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

qcktypes-1.2-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

Details for the file qcktypes-1.2.tar.gz.

File metadata

  • Download URL: qcktypes-1.2.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.18

File hashes

Hashes for qcktypes-1.2.tar.gz
Algorithm Hash digest
SHA256 8b51a4c6af7ade4a25a6aff92a1d852d7a8f7abd37f6830441c00b8c6db8645e
MD5 ba9e9ed637bf8147b90a8bc63ba2259b
BLAKE2b-256 97d10d9cf4a8204c2829bab0630d10d363bfc346e8f247a3ea2d1f475d5da893

See more details on using hashes here.

File details

Details for the file qcktypes-1.2-py3-none-any.whl.

File metadata

  • Download URL: qcktypes-1.2-py3-none-any.whl
  • Upload date:
  • Size: 3.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.18

File hashes

Hashes for qcktypes-1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b4962cedc1304695c7ea11bdb4c3330305d4ee6f0396bce46cab86f843bbce6d
MD5 637dddad2e7d8a64368bdd50310ac0a6
BLAKE2b-256 ef0d2c141a9bcf04b366e94e5bc853e522b1453b25f3f685990f212be009816a

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