skillfed

standard-imghdr

Standard library imghdr redistribution. "dead battery".

standard-imghdr v3.13.0 987.7K downloads/30d#4,571 on PyPI37
Permissive license PSF-2.0 DORMANT released

What it is and what it does

This package redistributes the `imghdr` module, which was removed from Python's standard library in version 3.13 as part of PEP 594's "dead batteries" initiative. The module provides a simple utility to determine image file types by reading and analyzing their file headers, returning a string identifier like 'png', 'jpeg', 'gif', or None if the format is not recognized.

It is intended for projects that depend on the original `imghdr` module and need to maintain compatibility with Python 3.13 and later. The package contains minimal compatibility support only—it is an archive of the removed standard library code made installable via pip, not an actively developed alternative. If you need advanced image format detection or additional features, you should consider other actively maintained packages.

Use it for:

  • Migrate legacy code that uses `imghdr` to Python 3.13+ without rewriting image type detection logic.
  • Quickly identify image file formats in batch processing or validation workflows where only basic format detection is needed.
  • Maintain backward compatibility in libraries that expose `imghdr` as part of their public API.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides the `imghdr` module, a Python standard library utility removed in Python 3.13 that identifies image file types by examining their headers.

Yes, if you have existing code that depends on `imghdr` and need to run it on Python 3.13+. Install it as a drop-in replacement for the removed standard library module. No, if you are starting a new project—consider a more actively maintained image library instead. The package itself is stable (it is a static archive of removed code) but receives no active development.

Install

standard-imghdr on PyPI

pip

pip install standard-imghdr

uv

uv add standard-imghdr

poetry

poetry add standard-imghdr

Installing standard-imghdr

Before you install

Low install friction with no runtime dependencies. Maintenance is dormant (last release 653 days ago), but the package is archived only as a redistribution of removed standard library code, so inactivity is expected and not a signal of neglect.

License in practice

Licensed under PSF-2.0 (Python Software Foundation License), a permissive license. You can use this package freely in most contexts without license concerns.

Quickstart

pip install standard-imghdr

import imghdr

image_type = imghdr.what('image.png')
print(image_type)  # Returns 'png' or None if not recognized

Verify before relying

  • Whether the redistributed imghdr module maintains full compatibility with the original standard library implementation across all supported Python versions.
  • Whether this package will receive updates if Python's removal of imghdr introduces breaking changes in future versions.

Package facts

License PSF-2.0 (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance dormant — 653 days since the last release
Last repo commit
First released
Downloads 987,665/month — #4,571 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: standard_imghdr-3.13.0-py3-none-any.whl

Keywords: stdlib

License :: OSI Approved :: Python Software Foundation LicenseProgramming Language :: Python :: 3Topic :: Software Development :: Libraries

Tags

image file type detectionimghdr standard libraryremoved stdlib modulesimage format identificationpython dead batteriesidentify image headers
stdlib-redistributionimage-detection

More Libraries packages