multipart
Parser for multipart/form-data
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 multipartuv
uv add multipartpoetry
poetry add multipartInstalling 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
Tags
More WWW/HTTP 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
h11h11 is a pure-Python HTTP/1.1 protocol…
permissive · top 100 on PyPI
httpxHTTPX is a fully featured HTTP client library…
permissive · top 100 on PyPI
httpcoreA minimal low-level HTTP client library that…
permissive · top 100 on PyPI
aiohttpaiohttp is an async HTTP client and server…
permissive · top 100 on PyPI
streaming-form-dataParses multipart/form-data streams…
permissive · top 15,000 on PyPI
requests-toolbeltProvides utilities for the requests library,…
permissive · top 1,000 on PyPI
python-multipartParses multipart form data from HTTP requests…
permissive · top 1,000 on PyPI
asgirefProvides ASGI base libraries including…
permissive · top 1,000 on PyPI
a2wsgiConverts between WSGI and ASGI applications…
permissive · top 5,000 on PyPI
sanicSanic is an async Python web framework and…
permissive · top 5,000 on PyPI
asgi-csrfASGI middleware that protects web applications…
permissive · top 15,000 on PyPI
async-asgi-testclientProvides an async test client for ASGI web…
permissive · top 15,000 on PyPI
uvicornUvicorn is an ASGI web server that runs async…
permissive · top 100 on PyPI
microsoft-kiota-serialization-multipartHandles multipart/form-data serialization for…
permissive · top 5,000 on PyPI