Ability to detect whether detect mimetype corresponds to the file extension
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2.9k
- Forks
- 304
- PR merge metrics
- No merged PRs in 30d
Description
As per https://github.com/ahupp/python-magic/issues/228#issuecomment-741967910, libmagic should be able to do this, but I do not see a way to get this library to give me the list of possible file extensions for a given file type.
Would be nice to have a verify_file_extension() function or something akin to it, but I can write that myself, it's just that I can't get the list at all.
mimetypes library does have a function for this.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the linked libmagic issue and comparing its capabilities with Python's mimetypes library. Determine whether the wrapper can expose possible extensions or support a verify_file_extension()-style API, then define tests showing that a detected MIME type can be checked against a file extension.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100