skillfed

zope.contenttype

Zope contenttype

zope-contenttype v6.0 172.8K downloads/30d#10,323 on PyPI1
License unclear ZPL-2.1 AGING released

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-contenttype

uv

uv add zope-contenttype

poetry

poetry add zope-contenttype

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: Zope Public LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Internet :: WWW/HTTPTopic :: Software Development

Tags

mime type detectioncontent type guessingmime type parsingfile type detectioncontent-type handling
mime-typecontent-detection

More Software Development packages