skillfed

multipart

Parser for multipart/form-data

multipart v2.0.0 5.6M downloads/30d#2,066 on PyPI157
Permissive license Active released

What it is and what it does

Multipart is a pure-Python parser for multipart/form-data submissions as defined by HTML5 and RFC7578. It provides three interfaces: PushMultipartParser for non-blocking, incremental parsing in ASGI and asyncio environments; MultipartParser for streaming from a byte source; and WSGI helpers for traditional blocking applications. The parser handles both multipart and urlencoded form submissions and implements fine-grained resource limits to control memory and disk consumption.

The package is designed for high throughput and low latency with no external dependencies. It includes a strict mode for rejecting malformed inputs and supports all modern browsers and HTTP clients. The parser does not handle email multipart formats, base64/quoted-printable encoding, or legacy broken clients—its scope is narrowly focused on web form submissions.

Use it for:

  • Parse file uploads in ASGI web frameworks like Starlette or FastAPI with non-blocking, incremental parsing.
  • Handle form submissions in traditional WSGI applications (Django, Flask) with the blocking MultipartParser or WSGI helpers.
  • Implement resource-constrained form parsing in memory- or disk-limited environments using configurable limits.
  • Validate and reject malformed form submissions early using strict mode without full parsing overhead.
  • Stream large file uploads directly to disk or object storage while maintaining predictable memory usage.

Worth the install?

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

Parses multipart/form-data submissions with both incremental non-blocking and streaming blocking interfaces, supporting ASGI, asyncio, WSGI, and CGI applications.

Yes. This is a mature, actively maintained parser with no dependencies, permissive licensing, and a focused scope on web form handling. It offers both blocking and non-blocking interfaces, making it suitable for WSGI, ASGI, and asyncio applications. No known vulnerabilities and low install friction make it a straightforward choice for any Python project handling multipart form data.

Install

multipart on PyPI

pip

pip install multipart

uv

uv add multipart

poetry

poetry add multipart

Installing multipart

Before you install

Low friction: pure Python, no runtime dependencies, distributed as a single wheel. Actively maintained with a release 27 days ago and ongoing repository activity.

License in practice

MIT license (permissive) means you can use, modify, and distribute this package freely in commercial and open-source projects with minimal restrictions.

Quickstart

pip install multipart

from multipart import MultipartParser

parser = MultipartParser(data_stream, content_type_header)
for part in parser:
    print(part.name, part.value)

Requires Python 3.10 or later.

Verify before relying

  • Whether the package's performance characteristics (throughput, latency, memory consumption) meet your specific application's requirements.
  • Whether strict mode's behavior on malformed input aligns with your error-handling strategy.

Package facts

License not declared (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance actively maintained — 27 days since the last release
Last repo commit
First released
Downloads 5,595,035/month — #2,066 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: multipart-2.0.0-py3-none-any.whl

Development Status :: 6 - MatureIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Internet :: WWW/HTTPTopic :: Internet :: WWW/HTTP :: Dynamic ContentTopic :: Internet :: WWW/HTTP :: Dynamic Content :: CGI Tools/LibrariesTopic :: Internet :: WWW/HTTP :: WSGI

Tags

multipart form data parserform submission parsingASGI form handlingasyncio multipart parserWSGI form parsernon-blocking multipartincremental form parser
form-parsingasync-readyzero-dependencies

More WWW/HTTP packages