--- id: multipart version: "2.0.0" license: unclear license_treatment: permissive maintenance: active --- # multipart — Parser for multipart/form-data License: permissive · Maintenance: active · Downloads: 5.6M/mo ## 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 above — 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 pip install multipart uv add multipart 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_current - Install friction: low - Maintenance: active - Downloads: 5.6M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags multipart form data parser, form submission parsing, ASGI form handling, asyncio multipart parser, WSGI form parser, non-blocking multipart, incremental form parser, form-parsing, async-ready, zero-dependencies [View on SkillFed](https://skillfed.io/packages/multipart) · [View on PyPI](https://pypi.org/project/multipart/)