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).

Metadata

Release files for multipart 2.0.2

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.2
File Size Uploaded Provenance Actions
multipart-2.0.2.tar.gz 44.4 kB Without provenance Details for multipart-2.0.2.tar.gz

Built distribution (wheel)

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

Total release size: 61.3 kB

Release files / multipart-2.0.2.tar.gz

Download URL multipart-2.0.2.tar.gz
Size 44.4 kB
Tags Source
SHA-256 checksum
How to use checksums
4bf489439b5b97d7e1b4694a0d7b13179657c23c48178be6c5e4cd3c5d12bd4e
BLAKE2b-256 checksum
How to use checksums
1a357b109a5d624506a4b278df24fa0b25fb5b0d36482e7f827b6dd373070cad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","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.2-py3-none-any.whl

Download URL multipart-2.0.2-py3-none-any.whl
Size 16.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5b1f83e45cf3c77a1df208c2ef4bab91c3bc315cee916497ef6f21056b19483d
BLAKE2b-256 checksum
How to use checksums
8ba9a8f257bcf66186425704c2006a049414a4ba829aaff10518c0870b1f5987
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","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}

Security for multipart 2.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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