Skip to main content

Python multipart/form-data parser

CI Status Latest Version Supported Python Version License

This module provides a fast incremental non-blocking parser for multipart/form-data [HTML5, RFC7578], as well as blocking alternatives for easier use in WSGI or CGI applications:

  • PushMultipartParser: Fast SansIO (incremental, non-blocking) parser suitable for ASGI, asyncio and other IO, time or memory constrained environments.

  • MultipartParser: Streaming parser that reads from a byte stream and yields memory- or disk-buffered MultipartPart instances.

  • WSGI Helper: High-level functions and containers for WSGI or CGI applications with support for both multipart and urlencoded form submissions.

Features

  • Pure python single file module with no dependencies.

  • Optimized for both blocking and non-blocking applications.

  • 100% test coverage with test data from actual browsers and HTTP clients.

  • High throughput and low latency (see benchmarks).

  • Predictable memory and disk resource consumption via fine grained limits.

  • Strict mode: Spend less time parsing malicious or broken inputs.

Scope and compatibility

All parsers in this module implement multipart/form-data as defined by HTML5 and RFC7578, supporting all modern browsers or HTTP clients in use today. Legacy browsers (e.g. IE6) are supported to some degree, but only if the required workarounds do not impact performance or security. In detail this means:

  • Just multipart/form-data, not suitable for email parsing.

  • No multipart/mixed support (deprecated in RFC7578).

  • No base64 or quoted-printable transfer encoding (deprecated in RFC7578).

  • No encoded-word or name=_charset_ encoding markers (deprecated in HTML5).

  • No support for clearly broken clients (e.g. invalid line breaks or headers).

Installation

pip install multipart

Documentation

Examples and API documentation can be found at: https://multipart.readthedocs.io/

License

Code and documentation are available under MIT License (see LICENSE).

Release files for multipart 2.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for multipart 2.0.1
File Size Uploaded
multipart-2.0.1.tar.gz 42.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for multipart 2.0.1
File Interpreter ABI Platform
multipart-2.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 59.3 kB

Release files / multipart-2.0.1.tar.gz

Download URL multipart-2.0.1.tar.gz
Size 42.8 kB
Tags Source
SHA-256 checksum
How to use checksums
5dfea7ce4260e10a9e620369449e7d41c269a94e192db9ea4af1a0059cddd370
BLAKE2b-256 checksum
How to use checksums
a5d5440ca1e07162d93b6645942e36e8721d2e54ff28d265abec73a6339a6c59
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release files / multipart-2.0.1-py3-none-any.whl

Download URL multipart-2.0.1-py3-none-any.whl
Size 16.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ac54d6bd0353ee30d2703af75adacd8b2052d4adb634e9e74dc7c5b06e0bcd86
BLAKE2b-256 checksum
How to use checksums
20f111873ce60ad824ac44f796de9879879dcd62672a172cbafe6e26eb2ea848
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release history Release notifications | RSS feed

This release

2.0.1 This release

2 release files

2.0.0

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2

2 release files

0.1.1

3 release files

0.1

3 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page