Streaming multipart/form-data parser
streaming_form_data provides a Python parser for parsing multipart/form-data
input chunks (the encoding used when submitting data over HTTP through HTML
forms).
Testimonials
this speeds up file uploads to my Flask app by more than factor 10
Installation
$ pip install streaming-form-data
In case you prefer cloning the Github repository and installing manually, please
note that main is the development branch, so stable is what you should be
working with.
Usage
>>> from streaming_form_data import StreamingFormDataParser
>>> from streaming_form_data.targets import FileTarget, NullTarget, GCSTarget, S3Target, ValueTarget
>>>
>>> headers = {"Content-Type": "multipart/form-data; boundary=boundary"}
>>>
>>> parser = StreamingFormDataParser(headers=headers)
>>>
>>> parser.register("name", ValueTarget())
>>> parser.register("file-local", FileTarget("/path/to/file.txt"))
>>> parser.register("file-s3", S3Target("s3://bucket/path/to/key"))
>>> parser.register("file-gcs", GCSTarget("gs://bucket/path/to/key"))
>>> parser.register("discard-me", NullTarget())
>>>
>>> for chunk in request.body:
... parser.data_received(chunk)
...
>>>
Documentation
Up-to-date documentation is available on Read the Docs.
Development
Please make sure you have Python 3.10+, uv, and task installed.
Since this package includes a C extension, please make sure you have a working C
compiler available. On Debian-based distros this usually means installing the
build-essentials package.
-
Git clone the repository:
git clone https://github.com/siddhantgoel/streaming-form-data -
Install the packages required for development:
uv sync -
That's basically it. You should now be able to run the test suite:
task test
Note that if you make any changes to Cython files (.pyx, .pxd, .pxi), you'll need to
re-compile (task compile) and re-install streaming_form_data before you can test
your changes.
Metadata
Release files for streaming-form-data 2.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| streaming_form_data-2.1.0.tar.gz | 150.9 kB | Details |
Built distributions (wheels)
Total release size: 7.9 MB
Release files / streaming_form_data-2.1.0.tar.gz
| Download URL | streaming_form_data-2.1.0.tar.gz |
|---|---|
| Size | 150.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2c5c81fc9c451ea133083bc6da959f87e9b91fba3effe99411f1f90461ea7c5b
|
|
BLAKE2b-256 checksum How to use checksums |
dcfdd49f3b4e6258e865566fd8aa3da9966f47ca5a7d7fd8ca181f8209010605
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / streaming_form_data-2.1.0-cp313-cp313-win_amd64.whl
| Download URL | streaming_form_data-2.1.0-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 207.9 kB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
2d688a0205d44441fdd38010f84b32a29668d81537909b2832d0ecdf02b43a2d
|
|
BLAKE2b-256 checksum How to use checksums |
d03d77b35bfca81c6cc4546c35b38998c5fde2d5783e3b3a14ceebced1415ed9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / streaming_form_data-2.1.0-cp313-cp313-win32.whl
| Download URL | streaming_form_data-2.1.0-cp313-cp313-win32.whl |
|---|---|
| Size | 197.9 kB |
| Tags | CPython 3.13 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
0d92b76a51ef0621b37c437deae8641589e21ff3b132a407b146753a7b7f6576
|
|
BLAKE2b-256 checksum How to use checksums |
2dcb1ea4254bc0cf107a0d853ccb3aca5f2db41f238de2e8b0dc7b55b51d114a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / streaming_form_data-2.1.0-cp313-cp313-musllinux_1_2_x86_64.whl
| Download URL | streaming_form_data-2.1.0-cp313-cp313-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 647.6 kB |
| Tags | CPython 3.13 Linux musl 1.2+ x86-64 |
|
SHA-256 checksum How to use checksums |
28209064b60d86ff065b2a0776adccebd849beb2507e7f9cb995597ae2d30980
|
|
BLAKE2b-256 checksum How to use checksums |
7e1fc8cffb5d4ce2d9fb02bd0190f66b682405e972e09a22517dd11a0f08f6bf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / streaming_form_data-2.1.0-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
| Download URL | streaming_form_data-2.1.0-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl |
|---|---|
| Size | 660.3 kB |
| Tags | CPython 3.13 Linux glibc 2.28+ x86-64 Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
a917c93e45df1e7296964f46a98ef4a73ab477c10cebe1abb2667c90983f4d73
|
|
BLAKE2b-256 checksum How to use checksums |
b7b40db7ffb320710b851ec290eedbbc5875a3e2b82fae3418632ac860c25b31
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / streaming_form_data-2.1.0-cp313-cp313-macosx_11_0_arm64.whl
| Download URL | streaming_form_data-2.1.0-cp313-cp313-macosx_11_0_arm64.whl |
|---|---|
| Size | 222.3 kB |
| Tags | CPython 3.13 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
a7841684f9ac6476cfb0288ab670c2b08b1f1a06ddcac67b851843c5e53b27b7
|
|
BLAKE2b-256 checksum How to use checksums |
134b6da0657b08df77c9b3399273976e7bde90b9156254bf6237d0d84dd440bf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / streaming_form_data-2.1.0-cp312-cp312-win_amd64.whl
| Download URL | streaming_form_data-2.1.0-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 208.5 kB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
76c36952a7399167984e0146b1dcd50fcd58e4adf58c28cb8150bd2973c5f8d5
|
|
BLAKE2b-256 checksum How to use checksums |
f9a553c01f6d0474d53bfdb9f32ffe6946101b499f6c698dd61ac560eace72be
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / streaming_form_data-2.1.0-cp312-cp312-win32.whl
| Download URL | streaming_form_data-2.1.0-cp312-cp312-win32.whl |
|---|---|
| Size | 198.1 kB |
| Tags | CPython 3.12 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
a08266f5328071d2b57c43448cacefbaf80ab5e33e3020401f064f688e748dbc
|
|
BLAKE2b-256 checksum How to use checksums |
e00f80db74a30563758768550276cb6b07d6e9248c24176cfb1f021abf47860c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / streaming_form_data-2.1.0-cp312-cp312-musllinux_1_2_x86_64.whl
| Download URL | streaming_form_data-2.1.0-cp312-cp312-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 651.4 kB |
| Tags | CPython 3.12 Linux musl 1.2+ x86-64 |
|
SHA-256 checksum How to use checksums |
055d40c7a03d56de9751167a95b62176f9b2283c808d4818f78b0ae4b872d166
|
|
BLAKE2b-256 checksum How to use checksums |
063b7c69ce4977a81a4e02221abd73c7de8a2e2f34a53987f64c041d2920d706
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / streaming_form_data-2.1.0-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
| Download URL | streaming_form_data-2.1.0-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl |
|---|---|
| Size | 664.2 kB |
| Tags | CPython 3.12 Linux glibc 2.28+ x86-64 Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
c10cc7dc41c79ea270ad93d1f1dc982750eb5b13f719d9a978f125c0b3b86371
|
|
BLAKE2b-256 checksum How to use checksums |
0931335732ff6f370eeb42391505a2d08c32ec5381b846cd619a4e58b2cbdad2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / streaming_form_data-2.1.0-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | streaming_form_data-2.1.0-cp312-cp312-macosx_11_0_arm64.whl |
|---|---|
| Size | 223.3 kB |
| Tags | CPython 3.12 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
109390324580f0bab0777f9f347843c29895aa78028aed86e5931158008ef369
|
|
BLAKE2b-256 checksum How to use checksums |
a4b23123dc2b39ff69a5cf7bea5fb2a0a7aa2b41c4c43d3c489eada7cc249873
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / streaming_form_data-2.1.0-cp311-cp311-win_amd64.whl
| Download URL | streaming_form_data-2.1.0-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 208.6 kB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
582912c9f488569ec8d7930d73abedbeb96dd74ea447b7d6fa4691e730276884
|
|
BLAKE2b-256 checksum How to use checksums |
bc6b2cd860cec26b65d1d65a1e371cb1fb094aa15a0cee6235f996d32c49fe22
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / streaming_form_data-2.1.0-cp311-cp311-win32.whl
| Download URL | streaming_form_data-2.1.0-cp311-cp311-win32.whl |
|---|---|
| Size | 198.5 kB |
| Tags | CPython 3.11 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
c9d17aaae0a171f74611cd2bead3dc39bf3cd5f02887af67aa8d4da5b3647022
|
|
BLAKE2b-256 checksum How to use checksums |
55b52bb7a12abdd81bccd311a12fbabe8c715774e2d99a12cedf0c294179154b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / streaming_form_data-2.1.0-cp311-cp311-musllinux_1_2_x86_64.whl
| Download URL | streaming_form_data-2.1.0-cp311-cp311-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 657.8 kB |
| Tags | CPython 3.11 Linux musl 1.2+ x86-64 |
|
SHA-256 checksum How to use checksums |
ab74a306ac7db0fc8a4539c62b55db0488d2f81928648a66ccfa0770051cc4f7
|
|
BLAKE2b-256 checksum How to use checksums |
ef69e50cd2c4fc8e216d7a6a073eea4239f744db8bf556b93fd8671b23e47358
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / streaming_form_data-2.1.0-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
| Download URL | streaming_form_data-2.1.0-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl |
|---|---|
| Size | 664.3 kB |
| Tags | CPython 3.11 Linux glibc 2.28+ x86-64 Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
97934de76c520182e8536748c8f07544d646777174a41215ee15c3eeca0de479
|
|
BLAKE2b-256 checksum How to use checksums |
0b110e3490b9ff2dc14dbff8baacf1c23c15f24f8ad3434327022b5f59e50e2a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / streaming_form_data-2.1.0-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | streaming_form_data-2.1.0-cp311-cp311-macosx_11_0_arm64.whl |
|---|---|
| Size | 223.1 kB |
| Tags | CPython 3.11 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
a94d5eb98399fa9bd69741a4fb784d92ea8a774850e099a4bb6bb5812d773ed7
|
|
BLAKE2b-256 checksum How to use checksums |
909a9239a3e8c6fb10e0367c3aec387eed816cc9fe411a43cd998203d269e3f5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / streaming_form_data-2.1.0-cp310-cp310-win_amd64.whl
| Download URL | streaming_form_data-2.1.0-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 208.1 kB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
a5b46ea82530e4f9be08396b388e38e3b89f26345a19e2f84ade0302d92cc5dc
|
|
BLAKE2b-256 checksum How to use checksums |
d5e2abd0b2b1772a91bfb979d52d5ddd5a70a1ed62506b0cd23c8450dd2c1f4d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / streaming_form_data-2.1.0-cp310-cp310-win32.whl
| Download URL | streaming_form_data-2.1.0-cp310-cp310-win32.whl |
|---|---|
| Size | 198.3 kB |
| Tags | CPython 3.10 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
0ef2778e554bc7db29f6493d229d2eea647f5df8b104cf017516a9bbf5e869fc
|
|
BLAKE2b-256 checksum How to use checksums |
b396e94f0ace935a23011ff44e3d0f9b88950159fd02b45a1528c3b57ef73876
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / streaming_form_data-2.1.0-cp310-cp310-musllinux_1_2_x86_64.whl
| Download URL | streaming_form_data-2.1.0-cp310-cp310-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 617.0 kB |
| Tags | CPython 3.10 Linux musl 1.2+ x86-64 |
|
SHA-256 checksum How to use checksums |
233026ea931b4043ddec64dc774753073a03caee5f76be450ceb73e15c31d016
|
|
BLAKE2b-256 checksum How to use checksums |
a977421e4437fb8eaee7c8396ea5a5d2d54ff22b96279dbae4cb251539824933
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / streaming_form_data-2.1.0-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl
| Download URL | streaming_form_data-2.1.0-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl |
|---|---|
| Size | 626.9 kB |
| Tags | CPython 3.10 Linux glibc 2.28+ x86-64 Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
b2269ddc234673d8b99863d0203f12d6127eda96d4c4155ae5728b9862f05c5e
|
|
BLAKE2b-256 checksum How to use checksums |
019eb71dd002d62a80e3f4ebcd6dba42a07ee180b7d800625e4e101b227b5013
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / streaming_form_data-2.1.0-cp310-cp310-macosx_11_0_arm64.whl
| Download URL | streaming_form_data-2.1.0-cp310-cp310-macosx_11_0_arm64.whl |
|---|---|
| Size | 221.9 kB |
| Tags | CPython 3.10 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
7efb67a2bf91419468f8c84d89fc997f0443ca7640efd2e4ebf31656253627a6
|
|
BLAKE2b-256 checksum How to use checksums |
71189bf597fd18a2a16c24981afa6ded6dde18d329c5959bf2d060d695d9a144
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|