--- id: mediatype version: "0.1.6" license: MIT license_treatment: permissive maintenance: dormant --- # mediatype — Media Type parsing and creation License: permissive · Maintenance: dormant · Downloads: 96.9K/mo ## What it is and what it does mediatype is a lightweight library for parsing and constructing MIME types (also called media types or content types). It breaks down a media type string like 'application/manifest+json' into its structural components—type, subtype, suffix, and optional parameters—and can reconstruct the string from those components. The library follows RFC-6838 specifications and is useful anywhere HTTP content negotiation, file type handling, or protocol parsing requires reliable media type manipulation. The package depends only on enumb and installs as a pure Python wheel, making it quick to add to any project. It supports Python 3.8 through 3.10. Because the last release was in April 2022 and the repository shows no recent activity, the package is stable but not actively developed; it is suitable for projects that need straightforward media type handling without expecting ongoing feature additions. Use it for: - Parse Content-Type headers in HTTP request/response handlers to extract and validate media types. - Build or validate MIME type strings programmatically when constructing HTTP responses or file metadata. - Decompose media types in content negotiation logic to match client Accept headers against server capabilities. - Normalize or canonicalize media type strings in APIs or data pipelines that consume untrusted input. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Parses and creates MIME types (media types) according to RFC-6838, decomposing them into type, subtype, suffix, and parameters or reconstructing them from components. Yes, if you need reliable MIME type parsing and don't require active maintenance. The package is stable, has no known vulnerabilities, and solves a narrow, well-defined problem with minimal dependencies. The dormant maintenance status is acceptable for a utility library with a stable specification (RFC-6838), but unsuitable if you need ongoing bug fixes or Python version support beyond 3.10. ## Install pip install mediatype uv add mediatype poetry add mediatype ## Installing mediatype Before you install: Low install friction; pure Python wheel with a single lightweight dependency (enumb). Maintenance is dormant—last release was 2022-04-12 and no commits since 2024-08-14, but the repository is not archived and the package remains functional for current Python versions. License in practice: MIT license (permissive) places no restrictions on use, modification, or distribution in proprietary or open-source projects. Quickstart: pip install mediatype import mediatype media_type = mediatype.parse('application/manifest+json') print(media_type.type, media_type.subtype, media_type.suffix) Verify before relying: - Whether the package handles all RFC-6838 edge cases (e.g., quoted parameters, charset encoding) or only common cases. - Performance characteristics when parsing large numbers of media types or complex parameter strings. - Whether enumb dependency is actively maintained and compatible with future Python releases. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: dormant - Downloads: 96.9K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags mime type parsing, media type handling, content-type parser, rfc 6838 mime, parse content type header, mime type creation, mediatype library, mime-type, http-headers, rfc-6838 [View on SkillFed](https://skillfed.io/packages/mediatype) · [View on PyPI](https://pypi.org/project/mediatype/)