standard-imghdr
Standard library imghdr redistribution. "dead battery".
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-imghdruv
uv add standard-imghdrpoetry
poetry add standard-imghdrInstalling 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
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
standard-distutilsProvides the distutils module from Python's…
permissive · top 15,000 on PyPI
standard-sunauProvides the sunau module, a standard library…
permissive · top 5,000 on PyPI
standard-telnetlibProvides the telnetlib module removed from…
permissive · top 15,000 on PyPI
standard-chunkProvides the chunk module, a removed Python…
permissive · top 5,000 on PyPI
standard-aifcProvides the aifc module, a pure-Python…
permissive · top 5,000 on PyPI
legacy-cgiProvides the cgi and cgitb modules removed from…
permissive · top 5,000 on PyPI
flake8-eradicateA flake8 plugin that detects commented-out code…
permissive · top 15,000 on PyPI
sgmllib3kA Python 3 port of the deprecated stdlib…
permissive · top 5,000 on PyPI
eradicateEradicate detects and removes commented-out…
permissive · top 5,000 on PyPI
noneA library providing additional utilities and…
permissive · top 15,000 on PyPI