1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117
|
Metadata-Version: 2.4
Name: multipart
Version: 1.3.0
Summary: Parser for multipart/form-data
Author-email: Marcel Hellkamp <marc@gsites.de>
Requires-Python: >=3.8
Description-Content-Type: text/x-rst
Classifier: Development Status :: 6 - Mature
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content :: CGI Tools/Libraries
Classifier: Topic :: Internet :: WWW/HTTP :: WSGI
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
License-File: LICENSE
Requires-Dist: pytest ; extra == "dev"
Requires-Dist: pytest-cov ; extra == "dev"
Requires-Dist: build ; extra == "dev"
Requires-Dist: twine ; extra == "dev"
Requires-Dist: tox ; extra == "dev"
Requires-Dist: tox-uv ; extra == "dev"
Requires-Dist: sphinx>=8,<9 ; extra == "docs"
Requires-Dist: sphinx-autobuild ; extra == "docs"
Project-URL: Changelog, https://multipart.readthedocs.io/en/latest/changelog.html
Project-URL: Documentation, https://multipart.readthedocs.io/
Project-URL: Homepage, https://multipart.readthedocs.io/
Project-URL: Issues, https://github.com/defnull/multipart/issues
Project-URL: PyPI, https://pypi.org/project/multipart/
Project-URL: Source, https://github.com/defnull/multipart
Provides-Extra: dev
Provides-Extra: docs
=================================
Python multipart/form-data parser
=================================
.. image:: https://github.com/defnull/multipart/actions/workflows/test.yaml/badge.svg
:target: https://github.com/defnull/multipart/actions/workflows/test.yaml
:alt: Tests Status
.. image:: https://img.shields.io/pypi/v/multipart.svg
:target: https://pypi.python.org/pypi/multipart/
:alt: Latest Version
.. image:: https://img.shields.io/pypi/pyversions/multipart.svg?color=%2334D058
:target: https://pypi.python.org/pypi/multipart/
:alt: Supported Python Version
.. image:: https://img.shields.io/pypi/l/multipart.svg
:target: https://github.com/defnull/multipart/
:alt: License
.. _HTML5: https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#multipart-form-data
.. _RFC7578: https://www.rfc-editor.org/rfc/rfc7578
.. _WSGI: https://peps.python.org/pep-3333
.. _ASGI: https://asgi.readthedocs.io/en/latest/
.. _SansIO: https://sans-io.readthedocs.io/
.. _asyncio: https://docs.python.org/3/library/asyncio.html
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 <https://github.com/defnull/multipart_bench>`_).
* Predictable memory and disk resource consumption via fine grained limits.
* Strict mode: Spent 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
=======
.. __: https://github.com/defnull/multipart/raw/master/LICENSE
Code and documentation are available under MIT License (see LICENSE__).
|