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.13.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 34087788c88912caa5b658020d1df66320369a8d98ec3a427dc36fd2618d864f |
|
MD5 | 6dcd75f5ba0366323dd99b99b7c7fed9 |
|
BLAKE2b-256 | 9e56bb2e447219204feaa2940a815811f95d1b21ae7d2c5424a6566f2f3a7510 |
Hashes for streaming_form_data-1.13.0-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ffb54c4b7dd4d498026d79edd7001b81b5dbac567a4006b406dfa637f3523cd |
|
MD5 | 26fa0aaf8918c0f7eabd602c31469f69 |
|
BLAKE2b-256 | 47129bee430e5df8ce712931de895542881a583ff4839a2adc22275945972a75 |
Hashes for streaming_form_data-1.13.0-cp310-cp310-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 42295051b044dc16c6f334ba91c67d3d914dbb7ba216458e3bf357678a42467f |
|
MD5 | e065bf58fbffca86ee30e8496e6c42fa |
|
BLAKE2b-256 | f6b93ec70c02350343d7b31d77d519a0252f5a719f45099e55a70de59205e561 |
Hashes for streaming_form_data-1.13.0-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | acc6f631f445f39170570e53fb920ee421fa637ec2c60b1f14c02f7563561d01 |
|
MD5 | fb8e4f2ca425b956d193699749565207 |
|
BLAKE2b-256 | 77c1c5d03dbb4860e3aa6306e6f66b5f961914bec631ca8d5123aa61cdae0827 |
Hashes for streaming_form_data-1.13.0-cp310-cp310-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d637a34865c08af368534ba75d23a4a3bfff8948bd1098e174a2aa7b976647bc |
|
MD5 | 83f64077b8b568bd9175668bd82c4647 |
|
BLAKE2b-256 | 6bc98c46c586cbd14b902c6e81c21473e9c4cca43b42f7db7852b7b9567df6d6 |
Hashes for streaming_form_data-1.13.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 369fb2dd44bf6f8f3a5f67778d5d9b8d8b6c7ac02fca76253260f669402f00b1 |
|
MD5 | 3a70578694ddfd67f4be668fce49ba5a |
|
BLAKE2b-256 | ef97f34efb7f4a3049f4f556d51dc81f4c9a2124ea2f1af627810b76cb393eeb |
Hashes for streaming_form_data-1.13.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a6e0de45d68424cfc5044aa9a9619d1de7c07ca86592e0f1eb5374f3c04517c9 |
|
MD5 | 0ab22b91719da1664a4570817ca2a403 |
|
BLAKE2b-256 | a32707d248b2ef92e425fb69fc577bcf23d71d39a4ba9170baedce38b398e1e7 |
Hashes for streaming_form_data-1.13.0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 17cdc9db4b301aed212025e8f892219805e459c9c740c00d7cd6ff35a7484b06 |
|
MD5 | ec73c010294b93e8b9ad3352d377f185 |
|
BLAKE2b-256 | 1ce3e6d8375087a6ab20f26b37979a26a616f23ae8a7db9c9036a2131fad196f |
Hashes for streaming_form_data-1.13.0-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c99016fa12f244965d83661ade4b3f22f0e6350a198d98abd842e93ab1d8462e |
|
MD5 | b80f3da8fcd5ef42146d45e68ec28b91 |
|
BLAKE2b-256 | 1e5a21a42d69d12a624def834e12f8780af26e019b39c02f429d4c76038272fe |
Hashes for streaming_form_data-1.13.0-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6764142fc1a205f9e99813590b58ce77697e9f54f3aa638463e0678046dddef2 |
|
MD5 | 205a76bf527ec59097fcc7b7c2601041 |
|
BLAKE2b-256 | 1e1c09655a44d285cbd57e6227307a5613983b8aa16ad0e814eae54b54d76abb |
Hashes for streaming_form_data-1.13.0-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | be40bfab33b98ef592bd1fa7a1de223a9ce429a119f5cd6cf85798552095b529 |
|
MD5 | d6b911e5af2505279cd9174896e464be |
|
BLAKE2b-256 | d5eb7fd41b25385beacc886af5b0b5aa437abf3d9b1607e4136366c23a51212f |
Hashes for streaming_form_data-1.13.0-cp39-cp39-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f6938bc5dc6c04802b01aad26d7ed3efe09d72e2cdaebdae4edcf4f5d4907af8 |
|
MD5 | e7d51a97492efd42687d69a1c116e953 |
|
BLAKE2b-256 | 5aa220679a4c95754cb3c51190540379ae449bfa0a22b854f2b98310690d8e93 |
Hashes for streaming_form_data-1.13.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 44856e50586ee11a6e1961de25d36bf81128166ff7774102de63a7c7ec1f1733 |
|
MD5 | a2af86b241c72bd227718265b3ffcdbe |
|
BLAKE2b-256 | a08aca639e32d6ba2794ac3e78c506704796356f266c74edf8dbbb55c2d5d69c |
Hashes for streaming_form_data-1.13.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 45edb6c5fa03c305d03cf9e824b9029444a7b260bd4e2aafe09d0ab5f59286d3 |
|
MD5 | 7933c06775a9aebb0f2ff3f93817f3f8 |
|
BLAKE2b-256 | 3c133c4e700e56ecc4216b14702eba1ea0aea2661348a7db6e9698c5b4b577ed |
Hashes for streaming_form_data-1.13.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0729b79c6f61cebe8a281f93883387f600f8a4fcfdf405a163205d16542747fd |
|
MD5 | 3dcb0b0ea08aaf08708d5b28a0161eec |
|
BLAKE2b-256 | 4e9b1e46d676119f321d5d47b2e9b5c031595265e133b0a346ace35faa3e63a9 |
Hashes for streaming_form_data-1.13.0-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9641b9b8eb04182731da5c67b7cddb05f0fb075b6fe7efb34a7f47f7896213a8 |
|
MD5 | 49dfbcde899e2c92ffbdd2ab43a66ba7 |
|
BLAKE2b-256 | 8c26f4aa398b43be4a0ac5aa502e5852e01af3ec4739b629469c363598207ab3 |
Hashes for streaming_form_data-1.13.0-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 08c5860db14ea236286721cf81a75fde2f29f5cb70deab3b6d35cfa93a64f87f |
|
MD5 | 0f3766be3f5f025e9d80c30febe8eeeb |
|
BLAKE2b-256 | 830648eb2c3a5580ac7520cafecb973c5b652a2ba53d092c32ecf6aa4f6ef25f |
Hashes for streaming_form_data-1.13.0-cp38-cp38-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 082712694ed6e6ba1d631369ce40974fd0663fcc166fd353ebc1e5f43d2918b8 |
|
MD5 | 83ada41ffe1ab1763a84456d4011350c |
|
BLAKE2b-256 | ac33ec62a09076e5ca4cda6d552edd4c276afb522b90e88267c48512c30f93f2 |
Hashes for streaming_form_data-1.13.0-cp38-cp38-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b978c74b465b7e502c2f163c9b529557e4ea872ec6270b071d9506d3023bebbb |
|
MD5 | dcd5212f67b9e20e0eddde0b738805cb |
|
BLAKE2b-256 | 790a51d4ed62a43f28242a73bfca2b1a92011291a42beaf4490471dfba1ddb68 |
Hashes for streaming_form_data-1.13.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a7b7258be7039d7283818fb15a051eae017836fb91d6f119af6c19c14cc47deb |
|
MD5 | 74d05a56b1ac1da0ac124423f038f97b |
|
BLAKE2b-256 | 586bd08cb919268f4b0d6d83ecbf7d23361166dc3309958f69e35cc3637ad1eb |
Hashes for streaming_form_data-1.13.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f24a2f74feb963d77b356f82e2a6403d2e9ea565d4575450367170e7f9625fd0 |
|
MD5 | 3b84eabd9aecbf823f3933d40b744a65 |
|
BLAKE2b-256 | ed6232ddfcaa00e6511702b0d90ab5036ed37cfbff0e521e8afd04cdd4e17677 |
Hashes for streaming_form_data-1.13.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4f138cde3cbfda741fe171db511382fe71ec893bf24bad224034283fc3162ce2 |
|
MD5 | 3cafe4da672d690024e0971db245c81b |
|
BLAKE2b-256 | ada3d148b15f05c9944cd467a5aef1a1251776d3fef25ad2e98ab98006e20465 |