zope.contenttype
Zope contenttype
What it is and what it does
zope.contenttype is a lightweight utility for working with MIME types in Python applications. It provides functions to guess content types from filenames with optional body data inspection, detect text content types from raw text, and parse MIME type strings into their components. The package wraps and extends Python's standard mimetypes module with additional MIME type mappings and convenience functions.
The package has minimal dependencies—only setuptools—making it easy to integrate into existing projects. It supports Python 3.9, 3.10, 3.11, 3.12, and 3.13 on both CPython and PyPy. The codebase is stable and production-ready, though releases are infrequent; it is typically used as a dependency in larger Zope ecosystem projects rather than as a standalone tool.
Use it for:
- Determine the MIME type of uploaded files before processing or storage in a web application
- Detect whether raw data is HTML, XML, or plain text for content routing decisions
- Parse and validate MIME type strings in HTTP headers or configuration files
- Extend file type detection beyond the standard library with additional MIME mappings
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Guesses MIME types from filenames and body data, parses MIME type strings, and detects text content types.
Yes, if you need MIME type detection with minimal overhead. The package is stable, has no known vulnerabilities, and installs with low friction. The unclear license treatment requires verification before use in proprietary or GPL-licensed projects. The aging maintenance status is not a blocker for a mature utility.
Install
zope-contenttype on PyPI
pip
pip install zope-contenttypeuv
uv add zope-contenttypepoetry
poetry add zope-contenttypeInstalling zope.contenttype
Before you install
Low friction install with a single setuptools dependency. Marked as aging (336 days since last release), but repo shows recent activity with last commit on 2026-02-03.
License in practice
Licensed under ZPL-2.1, marked as unclear in treatment. Verify compatibility with your project's license requirements before use.
Quickstart
pip install zope.contenttype
from zope.contenttype import guess_content_type
guess_content_type(name='document.pdf')
Verify before relying
- Whether ZPL-2.1 is compatible with your project's licensing constraints
- Whether the aging maintenance status affects your production use case
Package facts
| License | ZPL-2.1 (unclear) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — setuptools |
| Maintenance | aging — 336 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 172,811/month — #10,323 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: zope_contenttype-6.0-py3-none-any.whl
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
zope.datetimeParses and formats date/time strings in common…
unclear · top 15,000 on PyPI
mediatypeParses and creates MIME types (media types)…
permissive · top 15,000 on PyPI
python-mimeparseParses and matches MIME types against…
permissive · top 5,000 on PyPI
zope.publisherzope.publisher handles HTTP request and…
unclear · top 15,000 on PyPI
zope.viewletzope.viewlet provides a pluggable framework for…
unclear · top 15,000 on PyPI
zope.exceptionsProvides general-purpose exception classes and…
unclear · top 15,000 on PyPI
zope.filerepresentationDefines interfaces for representing objects as…
unclear · top 15,000 on PyPI
zope.contentproviderProvides a framework for building componentized…
unclear · top 15,000 on PyPI
zope.structuredtextParses and renders Zope structured text (STX),…
unclear · top 15,000 on PyPI
zope.configurationZope.configuration provides an extensible…
unclear · top 5,000 on PyPI