
Research
Security News
The Landscape of Malicious Open Source Packages: 2025 Mid‑Year Threat Report
A look at the top trends in how threat actors are weaponizing open source packages to deliver malware and persist across the software supply chain.
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.
Research
Security News
A look at the top trends in how threat actors are weaponizing open source packages to deliver malware and persist across the software supply chain.
Security News
ESLint now supports HTML linting with 48 new rules, expanding its language plugin system to cover more of the modern web development stack.
Security News
CISA is discontinuing official RSS support for KEV and cybersecurity alerts, shifting updates to email and social media, disrupting automation workflows.