
Security News
Vite Releases Technical Preview of Rolldown-Vite, a Rust-Based Bundler
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.
A library of helper methods for your Python project to get mime types and general file category
A library of helper methods for your Python project to get mime types and general file category
Available as a pypi package
pip install fttlib
from FTTLib import FTT
mimeType = FTT.getMimeType("Path/To/My/File.doc")
print(mimeType)
mimeType = FTT.getMimeType("Path/To/My/File.docx")
print(mimeType)
> application/msword
> application/vnd.openxmlformats-officedocument.wordprocessingml.document
category = FTT.getFileCategory("Path/To/My/File.docx")
print(category)
category = FTT.getFileCategory("Path/To/My/File.jpg")
print(category)
> FileCategory.Document
> FileCategory.Image
extensions = FTT.getMimeTypeFileExtensions("text/csv")
print(extensions[0])
> csv
This library is designed along the following tenets:
File media types are broken down into relatively few categories. Sub-categories may be considered in a future release according to information on Wikipedia Here are the guidelines that determine a file's category
While it is unrealistic to expect this library to provide a comprehensive list with all the file types the world has to offer, it would be nice if we could get close. Generally, if the file type is even remotely common, it is listed in one of the sources. You can submit a bug report for a file type that is missing or that you think should be added. You will have to include a reputable source as well.
FAQs
A library of helper methods for your Python project to get mime types and general file category
We found that fttlib demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.
Research
Security News
A malicious npm typosquat uses remote commands to silently delete entire project directories after a single mistyped install.
Research
Security News
Malicious PyPI package semantic-types steals Solana private keys via transitive dependency installs using monkey patching and blockchain exfiltration.