Streaming parser for multipart/form-data
Project description
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, S3Target, ValueTarget
>>>
>>> headers = {"Content-Type": "multipart/form-data; boundary=boundary"}
>>>
>>> parser = StreamingFormDataParser(headers=headers)
>>>
>>> parser.register("name", ValueTarget())
>>> parser.register("file-1", FileTarget("/path/to/file.txt"))
>>> parser.register("file-2", S3Target("s3://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.8+ and pip-tools 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:
make pip-sync
-
Install
streaming_form_data
itself:pip install .
-
That's basically it. You should now be able to run the test suite:
make test
Note that if you make any changes to Cython files (.pyx, .pxd, .pxi
), you'll need to re-compile (make compile
) and re-install streaming_form_data
before you can test your changes.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for streaming-form-data-1.16.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | cd95cde7a1e362c0f2b6e8bf2bcaf7339df1d4727b06de29968d010fcbbb9f5c |
|
MD5 | 1b09744398e3006d35f96123c4bce622 |
|
BLAKE2b-256 | 2ff1c73fcd060abed4ed4926842add45e0c4e9dac1d404f7978c7996fe2c6c80 |
Hashes for streaming_form_data-1.16.0-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6edb1e379fad699522492a21d3e91ab1ee1b1df34e0a147498251673b7cbbc00 |
|
MD5 | 3a43bfcf35f3fb70b1d06ec88fc22917 |
|
BLAKE2b-256 | c5d8b3f9d192fcc274eccf7842afcd52d8da25231ebea0c98d2d9c771c1729e4 |
Hashes for streaming_form_data-1.16.0-cp311-cp311-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 90690e80f206fa42736599ec9cd88bd2ba85d4645dd048c301472502110be911 |
|
MD5 | 19bf92afbe617713631c1eb3f9b12962 |
|
BLAKE2b-256 | 947a4e0eb99fdf782dc24172ce44a904b660d423ac108edc11da98680851f215 |
Hashes for streaming_form_data-1.16.0-cp311-cp311-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4d401b337659404babecbad6ddc157f593568f861ecb0be71cbe7b6e5a38dca8 |
|
MD5 | 33a6cb36bcc51d2955859931fa81a7bf |
|
BLAKE2b-256 | 100b601e7ae5b531db61d796075bb5a81fbaacba737030609d55eb8a4f969402 |
Hashes for streaming_form_data-1.16.0-cp311-cp311-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | df9b6e16ccfd92137c59a0c59d0ccdfd641e6fd10564404ef3387d84e1aebc5e |
|
MD5 | 578853826d942a9da1e498a8bc079521 |
|
BLAKE2b-256 | 2d018328d9bb38e47e4bb31d4eaf7b312c975e3caaabb1444562c5704689e398 |
Hashes for streaming_form_data-1.16.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 13f2f293e0591ff26efe31197929c4f46614a48e2cdbe46e051fef3258499886 |
|
MD5 | dca1c4fd31678ae3e7e8f991eb60c142 |
|
BLAKE2b-256 | 4dd173416887fb534da818ec28c2063e1e93f76e11dfbbc9edb171bdbe8caa01 |
Hashes for streaming_form_data-1.16.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d0aa082e2944d5305c41e0acb60c3d2261126c181a3330ff787aeac13d7cf1ce |
|
MD5 | c12c9bc20b48dc2401f6890661a7c7d8 |
|
BLAKE2b-256 | 047bcf29b633860b4e8200121ac385c1e7b6f22d330a36de19c4700e2c65511d |
Hashes for streaming_form_data-1.16.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 36e337fe1639fcb67161464e4f18389c288d0d57fa8a65b1f4bbd3f21af58d94 |
|
MD5 | a35408b1781ce2f7d5911f5db69ec826 |
|
BLAKE2b-256 | fc4b25e8562b49d41af55d537afd4433a7269d173476437f39e200b6801e6e59 |
Hashes for streaming_form_data-1.16.0-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a5b598d1a36ea619aa26a14dff9a5b83baa6368d1d79f56e8132b72d2070f413 |
|
MD5 | 6df9cc98d3e94812f3a94c35c31b265d |
|
BLAKE2b-256 | 2596631a6c1e02d475ebe8452d783d32c551dbbb60fa5a900451abd85d1686d5 |
Hashes for streaming_form_data-1.16.0-cp310-cp310-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 945c642f3d7fbee36cc4682124487ab2c3ee8f6b669c5bff07257ce89625b20c |
|
MD5 | a303fb9c18a281a6b38ffde03134ccbf |
|
BLAKE2b-256 | 62f74b3ee68957c2bbb64eb60bd1598931ca20e26f7a0256df4e09360ee08528 |
Hashes for streaming_form_data-1.16.0-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 929b7c69460b5516e65551b76333de1831cab8cc44fb0c5fc200847f3bd28538 |
|
MD5 | 9517ac0268a6815282ee9971937366b8 |
|
BLAKE2b-256 | f2228d843b0c9628aa8224122fadfec893d60b9fbb290893e88fee258ca6fdee |
Hashes for streaming_form_data-1.16.0-cp310-cp310-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a96f8a8013f6a209262592eedebf773de3316c22286ed3f1ef5ff39a19f1db9e |
|
MD5 | 88287608965beade32130b26bcaed105 |
|
BLAKE2b-256 | 7f8dd7619fa4ae14755f216a6111b33d89af2ba003dd9b77d3fc77a2be7eedd7 |
Hashes for streaming_form_data-1.16.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fb3b54af8d170d58dfd36d6418352c105c43a1a0b85e36772f23f0134bd8a741 |
|
MD5 | 12816ea7857e0358c451a7083a629880 |
|
BLAKE2b-256 | 3f12350fbfe8d1b2de7f031cb9854e6e1807f266bd2a0bc9eeb88acb2303b1f5 |
Hashes for streaming_form_data-1.16.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5b14be1adb391a2021a25b238ec48cefd20b34f85952b990996d6ffd0abfe0d8 |
|
MD5 | a1cbe8a02ef8d3df9d8466a272b96527 |
|
BLAKE2b-256 | e37de7571105ee16214afbe784cee89346fc051c9610919cc9fc9dddd61c15ad |
Hashes for streaming_form_data-1.16.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 68657763f5b9147d1cc54729ccc972af33097a405ee6b72607b7949c4eeecec8 |
|
MD5 | 526ccdb52b383514e6d27188a38e8e05 |
|
BLAKE2b-256 | e1d81b7528397a974e60b8e3d2617635b7d8c8fb3f7f21cef08674c411ef8877 |
Hashes for streaming_form_data-1.16.0-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f90d142755e8d60764e4ef883af9cc5fc5d103606fa27adcbbf986d17bff102a |
|
MD5 | 9368b4b3a88eaf8b353603e1a2bf91e8 |
|
BLAKE2b-256 | 3067f22d666ed861e1de51993c176d6446526446c664eb87b22d93e14d733e3a |
Hashes for streaming_form_data-1.16.0-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ba7430f542e9d8359b5f9b1445fd2d20b81930e031100e4e76cb7f064208811d |
|
MD5 | 991301d590ea429b9fecd5ed424f4240 |
|
BLAKE2b-256 | 9b5848f959001ec751d08ee5d418eec8b3f5e980ff5776b0188f4b5efb2015e1 |
Hashes for streaming_form_data-1.16.0-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e530661137aa3c38bbd2a98ec4bced7aa15ed8d8a61be6d98abe071e5a8dfc7b |
|
MD5 | 24a29959579d45f72bb23a87af2d702e |
|
BLAKE2b-256 | 2024144c0d3c37969f6fcabcbd04f8e76611de1b17235b77bebde32e4e14323a |
Hashes for streaming_form_data-1.16.0-cp39-cp39-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 391fb3ff03113ffa71a0067ab88ca622d0a1a085913c4e21962afae61e366871 |
|
MD5 | 132716ee789b64bd64a4b1b509c8995d |
|
BLAKE2b-256 | fb4ede3490ccefb2afe2af3207aa553966f58682a0ab0f01e876098f010e21b1 |
Hashes for streaming_form_data-1.16.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | decf1af5fad98a938acd93fba413312630a9ca9a03972bc55ff903f6ce4247d4 |
|
MD5 | b5c629dab3188bec2c36ef42926fa0e6 |
|
BLAKE2b-256 | 7e4af3f45d7c22b15428e3577eb907e1b7170a3ff313704100fcf6394ae640e3 |
Hashes for streaming_form_data-1.16.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cbcfa5bf257c4e6539df01e96d52d9e0f49085a58c5b8efdc98c9e88a3a39595 |
|
MD5 | 8ffc3e530afa1cca646d60f2a10e3cd1 |
|
BLAKE2b-256 | 76e47191c8e1ca948f3539cf9ef85b82143abeea0d4af37335a1935c1fef147f |
Hashes for streaming_form_data-1.16.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9d2540acfb7f8db7ab94d893f42d5b2fcf0145a25cd795e53bc841c001ded4f9 |
|
MD5 | 0fd4dc21937b258fe2905a672e8b143a |
|
BLAKE2b-256 | 66aea59bb8593b83f7ee00b0ef0edb98f36188228b834101e20d81dc20a3be26 |
Hashes for streaming_form_data-1.16.0-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d561e216501356b1142232d3a5f3a41ea435c50120e01996c853b2779ef3626b |
|
MD5 | 0ef6e06044bffc191513da977d4e6c04 |
|
BLAKE2b-256 | 28e7f78fb4404c35f5459c837991e9b789d04b9b147b7cbd39ad85657411b552 |
Hashes for streaming_form_data-1.16.0-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 16399b9dc231e856cfd2138356ab7017f43025a1c994371deb7fbd31bd73b411 |
|
MD5 | 978208121964b8de807bfa9bbe4d912b |
|
BLAKE2b-256 | d27e749da5e03c85897bcf244990bca9e763cea8b66acf28e97e6c6bc504d855 |
Hashes for streaming_form_data-1.16.0-cp38-cp38-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 79debb41691c669e1b7b254f41120c24ab27889dbc543861660df4472471e4ce |
|
MD5 | 84a3ff63f7dbb33e8ca03db380c90362 |
|
BLAKE2b-256 | fcaaa1d6b28774073df9df467de8ef665a4af37158eb0a93f965322e61304875 |
Hashes for streaming_form_data-1.16.0-cp38-cp38-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1bcdfccf7b3885f74ec78c86c5a74f2f4b766341c209b344459a1f42b9581f80 |
|
MD5 | 8887b0e34c4a551472bce76313532797 |
|
BLAKE2b-256 | e0865dfba110ebdae8bfa0cdb2ffc6912f920469e7ff594221af74c633496197 |
Hashes for streaming_form_data-1.16.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1c6d920e03146d652ceea0b46682e8ca4d7ff9017cb09ec24a1687c809c1582c |
|
MD5 | 3847d9872ad78f96793bb6bdde6748db |
|
BLAKE2b-256 | 1736c2e4acceceb65a9b479f51d0b6f0bc35c51b06e5c72e0417bf70cd069318 |
Hashes for streaming_form_data-1.16.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b61d097ad8a673272222acfa504cee9a745881d5a091dcb4e7ca39ed8e0edcb9 |
|
MD5 | 9ba8926d759882f432c11d1e7bc421d3 |
|
BLAKE2b-256 | 2c757e4f656d9931fbabceb3f8514cf422b907c4bb6c730ce50289d4a925032d |
Hashes for streaming_form_data-1.16.0-cp38-cp38-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef7b63d02f4243251a5a6e7dc62bb5dda0d9342e141c724fb196410b04191508 |
|
MD5 | 4e5211fa0c70b98b012115d4e54594b1 |
|
BLAKE2b-256 | ee6ea646144eb730426801b253716f13f11adc0eb29f7b732fdaf1dca1ee232c |