Back to Explore

h2non/filetype.py

GitHub
1 watchersOpen source

Last release: 2022-11-08

filetype.py is a small, dependency-free Python package that infers a file type and MIME type by checking a file’s magic number signatures. It also supports getting an inferred extension, discovering types by extension or MIME, and can work from the first 261 bytes of a file or buffer.

Project status

  • The source (h2non/filetype.py) appears quiet or in maintenance mode, with the most recent upstream push on 2025-05-02 and the last publicly described tagged update in 2022-11-08 (v1.2.0), which is well over 12 months ago relative to 2026-06-09.
  • The apparent update cadence is sparse, with no evidence of regular ongoing updates (tagged updates span 2022-04 through 2022-11, then a long gap afterward).

AI summary generated 2026-06-09

AI-generated from public sources. May be inaccurate. Report

Recent updates

  • v1.2.0

    2022-11-08

    v1.2.0 expands file type detection significantly by adding new matchers for APNG, AVIF, Zstd, and multiple Microsoft and OpenDocument office document formats. The code also adjusts several signature-matching routines for robustness and to reduce false positives (or broaden detection), including changes that can affect which type is chosen when multiple matchers could match.

  • v1.1.0

    2022-07-12

    v1.1.0 adds detection support for Zstandard archives (zst) and improves some signature matching edge cases, including PDF files that start with a UTF-8 BOM. The code diff also includes a notable change to how inputs are converted to bytes internally (filetype/utils.py), which can break existing callers that relied on passing file-like objects.

    Features
  • v1.0.13

    2022-04-21

    v1.0.13 was published on 2022-04-21, but the release notes were not provided by the publisher. As a result, there is no documented information about new features, fixes, breaking changes, or dependency updates in this release.

  • v1.0.11

    2022-04-19

    Release v1.0.11 was published on 2022-04-19. No release notes were provided, so the specific changes, bug fixes, or potential breaking changes cannot be determined from the release description alone.