Comparison
filetype vs libmagic vs puremagic vs python-magic-bin
Maintenance, adoption and momentum side by side, from PyPI, GitHub and deps.dev data refreshed every day.
Infer file type and MIME type of any file/buffer. No external dependencies.
Likely abandoned. No release or commit for years (last release over 4 years ago).
pip install filetypelibmagic bindings
Likely abandoned. No release or commit for years (last release over 14 years ago).
pip install libmagicPure python implementation of magic file detection
Maintained. Last release 2 weeks ago, commits in 2 of the last 26 weeks. Weaker on commit activity and contributor spread.
pip install puremagicFile type identification using libmagic binary package
Archived. The repository is read-only: no more fixes or releases will come.
pip install python-magic-binIn short
- filetype looks abandoned: avoid it for new projects.
- libmagic looks abandoned: avoid it for new projects.
- python-magic-bin is archived: avoid it for new projects.
- puremagic is the most used: 10.5M downloads a month.
- puremagic also has the best Pythie’s Index (62).
- Safe default for a new project: puremagic.
Side by side
| Metric | filetype | libmagic | puremagic | python-magic-bin |
|---|---|---|---|---|
| Pythie’s Index | Pythie’s Index: 20 | Pythie’s Index: 19 | Pythie’s Index: 62 | Pythie’s Index: 5 |
| Verdict | Likely abandoned | Likely abandoned | Maintained | Archived |
| Downloads / month | 48.4M | 168.2K | 10.5M | 66.8K |
| Downloads, month over month | +15% | -8% | +8% | +4% |
| GitHub stars | 779 | – | 249 | 33 |
| Stars, last 7 days | – | – | – | – |
| Direct dependents | 670 | 14 | 125 | 51 |
| Last release | Nov 2, 2022 | Mar 2, 2012 | Nov 16, 2026 | Oct 2, 2017 |
| Releases, 12 months | 0 | 0 | 8 | 0 |
| Weeks with commits | 0 / 26 | – | 2 / 26 | 1 / 26 |
| Recent contributors | 16 | – | 3 | 27 |
| First release | Jun 2016 | Mar 2012 | Dec 2016 | Sep 2017 |
| Python versions | 3.5 – 3.9 | – | 3.12 – 3.15 | – |
| License | MIT | GPL-3.0 | MIT | MIT |
| Known vulnerabilities | None | None | None | None |
Bold marks the best value in each row. Pythie’s Index rates maintenance out of 100: how it works.