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 ValueTarget, FileTarget, NullTarget
>>>
>>> headers = {'Content-Type': 'multipart/form-data; boundary=boundary'}
>>>
>>> parser = StreamingFormDataParser(headers=headers)
>>>
>>> parser.register('name', ValueTarget())
>>> parser.register('file', FileTarget('/tmp/file.txt'))
>>> 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.12.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 88842c33ab2ef75de1c1d86d989d22edcde8b335112dd8d5080b1cc7abe9c10c |
|
MD5 | 3bbbe90bfe91c5ec0a999a92407d4a04 |
|
BLAKE2b-256 | 038e292cc146d093ec1cbf7b105762b20c87b59021ef371d52ed9351900c926f |
Hashes for streaming_form_data-1.12.0-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cdd5b0f2d65d9533fbdd2c4e3a9a2a0eb85eefd86cd003fced99bf8493f3d5f3 |
|
MD5 | f73e6133ccd9e497811b669d4b301bd4 |
|
BLAKE2b-256 | 981071d3666899531448d10e1cacbd7ee70f42688b6d657246deb194639bb3e0 |
Hashes for streaming_form_data-1.12.0-cp310-cp310-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4514f5277df90a43bb8ab0eb8a50cb9d6074076bd69a8df80a8625245c7dada2 |
|
MD5 | dcfb000ae845f727c8113fc291763008 |
|
BLAKE2b-256 | 1498993acbd59ba42eb4fd410c6957f20b793cee46d8cf19687fef5cb4fb309e |
Hashes for streaming_form_data-1.12.0-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | df4ad7fe6d9ef528147f05e8ed31b77d334fa7bcd4c8cef3d2fc6e24c75b814a |
|
MD5 | 2400e82670768648cb146bc1b32555f2 |
|
BLAKE2b-256 | a59ce2f8216d48fb580d39efbe3468c3850d3a5ffaaaee0ac6a6ff5ed659984b |
Hashes for streaming_form_data-1.12.0-cp310-cp310-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6151c43d0f8a0b19df5e5d90aed5d6cd1e4d3f0411850aede16ad5c0041b1984 |
|
MD5 | 8ff9442f1bee64aab37ede0041843ba8 |
|
BLAKE2b-256 | bc4851269278f5e3e00a78e4df087bb0038005c70c4596fdb28d45654af6b43d |
Hashes for streaming_form_data-1.12.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c2ba1bc02be2934f10ed05427d258d9e3b147343b00b487981933c5a4b661cea |
|
MD5 | 8b526a722034c31bf4ad3ee9b4982c62 |
|
BLAKE2b-256 | 237c8c1281c24c86d89d0e1109247666a8bd5d965b9803108477cf07ef7383b8 |
Hashes for streaming_form_data-1.12.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fc3269a401b28a2673716a99dd7ff16220e24f11b2d2e9bc8bcab146e6ae90f7 |
|
MD5 | 3246afb52a241a93776f88f2abf6f5e3 |
|
BLAKE2b-256 | 48c3df68fb5df6f9b1275ab8c89cb87e8825504267d6a69fcd78ba9baabbfa7d |
Hashes for streaming_form_data-1.12.0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b0eac28ddc4e99c1d15eba098e4848de8ba69552739668d0eeb605891e624cdf |
|
MD5 | b0d1b00128dc0e26b4b6a659172f2f89 |
|
BLAKE2b-256 | f9e5a6eb9d1dcca1eb6ae2517087e5e36768157cea7972e314a05046749b54ff |
Hashes for streaming_form_data-1.12.0-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b9e76bf57b414b8f88c2983ea7a5e2c05ae205a3c2d89a9b3e07cd38164f5f5b |
|
MD5 | 7ca86ec296c39abd189e2179d985c257 |
|
BLAKE2b-256 | d949f4adc1e36fb311f6cd82dddc9249b1fb716c13eccd0d78f7f9e1f414e78e |
Hashes for streaming_form_data-1.12.0-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b8da9493d9da92e986920e8c4dd770d9c02bb24e58ee83b33664e3943535c559 |
|
MD5 | d5042e383fe1b54a6c4f7267ee867e00 |
|
BLAKE2b-256 | 1e134cd80b8b3ee2069c9b56bfcc3cecc793c5a932df2d002415957eaf642750 |
Hashes for streaming_form_data-1.12.0-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 592a887cbdf3b12847929202334829befd6dcacf8699c5f21eef9906f7f473e6 |
|
MD5 | d3497c58926e557fffe7e1fdf0679849 |
|
BLAKE2b-256 | 164686b9135d5e3e8303553d2a0deee7c9769d0974812749febf824de34dff39 |
Hashes for streaming_form_data-1.12.0-cp39-cp39-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5face99c192b803885217991a56f817eaf08a754ec682e0d976f3e722af050d2 |
|
MD5 | 39ddcc4b18defec704ee5006b9108acc |
|
BLAKE2b-256 | 4d08b051c3c750a50befcd86f467ae984efec6d27bbf608d2f88c75f93a6355f |
Hashes for streaming_form_data-1.12.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 66d7bab02c34e38caa84cc5cbaba206b7777b93d2dafbd2df1106e657cde9207 |
|
MD5 | 84b2f1cad2db4f8582e80de5d520f0cb |
|
BLAKE2b-256 | 7521627d20ba3fef63c220ae78680ef7f8caa2957d364502e1569af069e98e24 |
Hashes for streaming_form_data-1.12.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 29f8ed8b2188cee5b32ddbc6682752187f6d1a722b4eff2577dec9bd7da58f60 |
|
MD5 | 78e4b4dddd99580fdab36aa99b52fcc1 |
|
BLAKE2b-256 | 644489a3a78ff54b2798d9caf3b7bc0106ebe869fab166ab8fa6c87a049c4caa |
Hashes for streaming_form_data-1.12.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 87c1ad1fe4828d54f289581df045e6951369a1615a3e75786f2226046686c6f1 |
|
MD5 | 97fc6a7f7cf2759a6d510e06c1ab4dd4 |
|
BLAKE2b-256 | 3e23ff95b7b64b7c78d87fb30014261c4d3086db921e171a9c39cbafcc1528c9 |
Hashes for streaming_form_data-1.12.0-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a6be500fd934b88ddc95784a4a60580838350c49ffd6589edf885e50395284b7 |
|
MD5 | fbeef6dc68a544a5bb4810fc5a6e9f85 |
|
BLAKE2b-256 | 2854d62f49df3257599e669289dda0b9aa4ebd3717ce04a35561acc2b3ff0b0f |
Hashes for streaming_form_data-1.12.0-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d3f8672726d067d5e2994ee4f24ab913066ce9dbb4af722c4bf407ad67f64dba |
|
MD5 | 437b108688be977ad0e1bbd0fad39cdd |
|
BLAKE2b-256 | 558ccd68e41b054ac80476ffccf83dae8445c55e15bca6c2afcf7bce9fae1666 |
Hashes for streaming_form_data-1.12.0-cp38-cp38-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 948348b604a1c04cb6242cd51f095f9a84aca4fbf4e8295dbfb089461da19ba2 |
|
MD5 | 5901adb9ebb38e7cf50e69b1e4db56f7 |
|
BLAKE2b-256 | fcc75ee3f7698f77073442fb8efc384621a32184ec20166f135afd0f68a1b1af |
Hashes for streaming_form_data-1.12.0-cp38-cp38-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4a0e034434665d26004c6ad540520e1c7b9d65cfbc9edd14e58b4a84e380416d |
|
MD5 | a1c3f44779a7059069783aaff12aeaf7 |
|
BLAKE2b-256 | ea53ef82ea2b82514cdc088ceb14ae8fa445319737beebc0017b8595ef5c2725 |
Hashes for streaming_form_data-1.12.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e001697be9ed464f776b34181b2793b592db18e0eecc9485c8007672662d5a13 |
|
MD5 | 1d28cedab1c1eb1cf7379bac4033cdb3 |
|
BLAKE2b-256 | 70bea20f29029fc9a652559c6c8f312ac0e786c02952f9741cd78530adfd4f9b |
Hashes for streaming_form_data-1.12.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | edcfa8b83320a13906d3c0634878c8ae7ab129e098384ea9e1e8988a272670c1 |
|
MD5 | b8cc56e289943fbd96dd8ede28b27da7 |
|
BLAKE2b-256 | 5679dc046ffc1785c2bd1f2951788068a6352c9e8a4aaf855ed199885001ded5 |
Hashes for streaming_form_data-1.12.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3f4339a46e3d5c8094d382aead3356ddf838d44edfa5af72a8719d63d6aac1cf |
|
MD5 | 82ae37c07496674f95d229484aac0ae5 |
|
BLAKE2b-256 | 994be00bddf29d50ca94af819137f93639159de1f6639f756faf7a1a5157c212 |