Skip to main content
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.0

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.0
File Size Uploaded
multipart-2.0.0.tar.gz 42.6 kB Details

Built distribution (wheel)

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

Total release size: 59.0 kB

Release files / multipart-2.0.0.tar.gz

Download URL multipart-2.0.0.tar.gz
Size 42.6 kB
Tags Source
SHA-256 checksum
How to use checksums
d6076567b489270271d9ec103d404745da1501ad5b70e3a7f1f07f5623d82850
BLAKE2b-256 checksum
How to use checksums
49c4f3f0c57ec3e845bae038d3849af0e2b9d3f62a046b2a09af3f697ad882d6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Linux Mint","version":"22.3","id":"zena","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

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

Download URL multipart-2.0.0-py3-none-any.whl
Size 16.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b3d4d473c4b96bb43e0d54b76fcc3b89b904df28387daf54e08405eb2123a081
BLAKE2b-256 checksum
How to use checksums
71ddfeb9c23d5c5a382194a9f86b02e98b8724d745e1a1cf4ecb1a5c0f884aa1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Linux Mint","version":"22.3","id":"zena","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

2.0.0 This release

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