| 1 |
Metadata-Version: 2.4 |
| 2 |
Name: multipart |
| 3 |
Version: 1.3.1 |
| 4 |
Summary: Parser for multipart/form-data |
| 5 |
Author-email: Marcel Hellkamp <[email protected]> |
| 6 |
Requires-Python: >=3.8 |
| 7 |
Description-Content-Type: text/x-rst |
| 8 |
Classifier: Development Status :: 6 - Mature |
| 9 |
Classifier: Intended Audience :: Developers |
| 10 |
Classifier: License :: OSI Approved :: MIT License |
| 11 |
Classifier: Topic :: Internet :: WWW/HTTP |
| 12 |
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content |
| 13 |
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content :: CGI Tools/Libraries |
| 14 |
Classifier: Topic :: Internet :: WWW/HTTP :: WSGI |
| 15 |
Classifier: Programming Language :: Python :: 3 |
| 16 |
Classifier: Programming Language :: Python :: 3.8 |
| 17 |
Classifier: Programming Language :: Python :: 3.9 |
| 18 |
Classifier: Programming Language :: Python :: 3.10 |
| 19 |
Classifier: Programming Language :: Python :: 3.11 |
| 20 |
Classifier: Programming Language :: Python :: 3.12 |
| 21 |
Classifier: Programming Language :: Python :: 3.13 |
| 22 |
License-File: LICENSE |
| 23 |
Requires-Dist: pytest ; extra == "dev" |
| 24 |
Requires-Dist: pytest-cov ; extra == "dev" |
| 25 |
Requires-Dist: build ; extra == "dev" |
| 26 |
Requires-Dist: twine ; extra == "dev" |
| 27 |
Requires-Dist: tox ; extra == "dev" |
| 28 |
Requires-Dist: tox-uv ; extra == "dev" |
| 29 |
Requires-Dist: sphinx>=8,<9 ; extra == "docs" |
| 30 |
Requires-Dist: sphinx-autobuild ; extra == "docs" |
| 31 |
Project-URL: Changelog, https://multipart.readthedocs.io/en/latest/changelog.html |
| 32 |
Project-URL: Documentation, https://multipart.readthedocs.io/ |
| 33 |
Project-URL: Homepage, https://multipart.readthedocs.io/ |
| 34 |
Project-URL: Issues, https://github.com/defnull/multipart/issues |
| 35 |
Project-URL: PyPI, https://pypi.org/project/multipart/ |
| 36 |
Project-URL: Source, https://github.com/defnull/multipart |
| 37 |
Provides-Extra: dev |
| 38 |
Provides-Extra: docs |
| 39 |
|
| 40 |
================================= |
| 41 |
Python multipart/form-data parser |
| 42 |
================================= |
| 43 |
|
| 44 |
.. image:: https://github.com/defnull/multipart/actions/workflows/test.yaml/badge.svg |
| 45 |
:target: https://github.com/defnull/multipart/actions/workflows/test.yaml |
| 46 |
:alt: Tests Status |
| 47 |
|
| 48 |
.. image:: https://img.shields.io/pypi/v/multipart.svg |
| 49 |
:target: https://pypi.python.org/pypi/multipart/ |
| 50 |
:alt: Latest Version |
| 51 |
|
| 52 |
.. image:: https://img.shields.io/pypi/pyversions/multipart.svg?color=%2334D058 |
| 53 |
:target: https://pypi.python.org/pypi/multipart/ |
| 54 |
:alt: Supported Python Version |
| 55 |
|
| 56 |
.. image:: https://img.shields.io/pypi/l/multipart.svg |
| 57 |
:target: https://github.com/defnull/multipart/ |
| 58 |
:alt: License |
| 59 |
|
| 60 |
.. _HTML5: https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#multipart-form-data |
| 61 |
.. _RFC7578: https://www.rfc-editor.org/rfc/rfc7578 |
| 62 |
.. _WSGI: https://peps.python.org/pep-3333 |
| 63 |
.. _ASGI: https://asgi.readthedocs.io/en/latest/ |
| 64 |
.. _SansIO: https://sans-io.readthedocs.io/ |
| 65 |
.. _asyncio: https://docs.python.org/3/library/asyncio.html |
| 66 |
|
| 67 |
This module provides a fast incremental non-blocking parser for |
| 68 |
``multipart/form-data`` [HTML5_, RFC7578_], as well as blocking alternatives for |
| 69 |
easier use in WSGI_ or CGI applications: |
| 70 |
|
| 71 |
* **PushMultipartParser**: Fast SansIO_ (incremental, non-blocking) parser suitable |
| 72 |
for ASGI_, asyncio_ and other IO, time or memory constrained environments. |
| 73 |
* **MultipartParser**: Streaming parser that reads from a byte stream and yields |
| 74 |
memory- or disk-buffered `MultipartPart` instances. |
| 75 |
* **WSGI Helper**: High-level functions and containers for WSGI_ or CGI applications with support |
| 76 |
for both `multipart` and `urlencoded` form submissions. |
| 77 |
|
| 78 |
Features |
| 79 |
======== |
| 80 |
|
| 81 |
* Pure python single file module with no dependencies. |
| 82 |
* Optimized for both blocking and non-blocking applications. |
| 83 |
* 100% test coverage with test data from actual browsers and HTTP clients. |
| 84 |
* High throughput and low latency (see `benchmarks <https://github.com/defnull/multipart_bench>`_). |
| 85 |
* Predictable memory and disk resource consumption via fine grained limits. |
| 86 |
* Strict mode: Spent less time parsing malicious or broken inputs. |
| 87 |
|
| 88 |
Scope and compatibility |
| 89 |
======================= |
| 90 |
All parsers in this module implement ``multipart/form-data`` as defined by HTML5_ |
| 91 |
and RFC7578_, supporting all modern browsers or HTTP clients in use today. |
| 92 |
Legacy browsers (e.g. IE6) are supported to some degree, but only if the |
| 93 |
required workarounds do not impact performance or security. In detail this means: |
| 94 |
|
| 95 |
* Just ``multipart/form-data``, not suitable for email parsing. |
| 96 |
* No ``multipart/mixed`` support (deprecated in RFC7578_). |
| 97 |
* No ``base64`` or ``quoted-printable`` transfer encoding (deprecated in RFC7578_). |
| 98 |
* No ``encoded-word`` or ``name=_charset_`` encoding markers (deprecated in HTML5_). |
| 99 |
* No support for clearly broken clients (e.g. invalid line breaks or headers). |
| 100 |
|
| 101 |
Installation |
| 102 |
============ |
| 103 |
|
| 104 |
``pip install multipart`` |
| 105 |
|
| 106 |
Documentation |
| 107 |
============= |
| 108 |
|
| 109 |
Examples and API documentation can be found at: https://multipart.readthedocs.io/ |
| 110 |
|
| 111 |
License |
| 112 |
======= |
| 113 |
|
| 114 |
.. __: https://github.com/defnull/multipart/raw/master/LICENSE |
| 115 |
|
| 116 |
Code and documentation are available under MIT License (see LICENSE__). |
| 117 |
|