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.15.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 891e011bcc18dceea06f64b20d65d79f77830bf6d746ae89d8debdce16afeea5 |
|
MD5 | 34e8e720be17ec1c35d6580ff9ac7418 |
|
BLAKE2b-256 | edefa8d74a9521cfea78b3b2509ae7f4d7d04f1afd2e2317e61e90115e9a5a11 |
Hashes for streaming_form_data-1.15.0-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f99868952c57684cc341c58a877664ab72d3a1d948037264b26517626024e8f1 |
|
MD5 | dee1dda880bd1a9e0b18afeaa37a68d8 |
|
BLAKE2b-256 | 8d184f39dfe569347d034258e793a3141d8da5a32deac184f469c5c6607bee01 |
Hashes for streaming_form_data-1.15.0-cp311-cp311-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c158ed2791e574f28ef0c0b91a94fb941751306bf495163ed84bad3f68fe7ea |
|
MD5 | dd5a7f761f62a8a9ea595ac36154c3a4 |
|
BLAKE2b-256 | 58422c191122cf6aff4da96ca2238109d6421a9816784f0d47399ab64b44b25f |
Hashes for streaming_form_data-1.15.0-cp311-cp311-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a8a4e2be7d2d6034892a419ae0f1486b1479edc7a6003c4215cb4f5f2d76b08 |
|
MD5 | 842364f72109a7f02ed40c294a6c9aad |
|
BLAKE2b-256 | 6155c804e87b7d790cfb1814c4502cab96eaa0476136f9cbbbac21a575a77131 |
Hashes for streaming_form_data-1.15.0-cp311-cp311-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6c85d472a245dc64c17d9f339c1ebdf3d1db608fbf85e6024e59e2c81a7d365d |
|
MD5 | 74a80471ebdb31dc2fe9e453aa302233 |
|
BLAKE2b-256 | fc28b00808ecbefb4fc13de215a8f7000c3ce87ad06d811428645c9d82392021 |
Hashes for streaming_form_data-1.15.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2a6cd81dd069e5ed0703042ac14126526b8eb39067b92a7f3dd7c2a89dcdbbf5 |
|
MD5 | 2cacad90db32b3a63adfc9ee6ebcb618 |
|
BLAKE2b-256 | aeceb4bcfc82176f94e90d34621b9ad71763fa32c79d5289d7b342f2a01f84bb |
Hashes for streaming_form_data-1.15.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6360053030d3c4032dd49f923f5fa536063534fb2c100fcb7b733fe83bc320e2 |
|
MD5 | 4635cfeb222611c2abc0fde2e66266f2 |
|
BLAKE2b-256 | 8f4020fc9a3ce0fb3fad7d861d6bb02d47754353cdd36b4cebe2374d8174bd90 |
Hashes for streaming_form_data-1.15.0-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef03c03b318804fb634af7961759a74c03bef665c0c9174e186a7a345f77ce1f |
|
MD5 | 3fa647b26a367e60a4e0f291876c6633 |
|
BLAKE2b-256 | e5898dcc034024279092a77ae2e9281d35ea20502b8dfa0694baabf8fb9a18a1 |
Hashes for streaming_form_data-1.15.0-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b9cda6a8c290424b8c5c00cfaf18103030fc256fe68d3291635f4b180e9b6ae6 |
|
MD5 | e1c04bb61a8d9af2d6ffaebaa3fbcfeb |
|
BLAKE2b-256 | be0d8c6465b106e9d9f1073786162177a247f4e55f3b4da037050b5e221afa55 |
Hashes for streaming_form_data-1.15.0-cp310-cp310-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f5f6397c0ed02a51cb8d6f0b4ad1a76d09c5e05fe8fdbb9a2227187139276660 |
|
MD5 | a7e5f2610a682448149fee3c8ffe17d6 |
|
BLAKE2b-256 | 98a81cd5ebdcd15bf0949370ab2931d7fb02a1d113536a1b53a0052ae3ef10ff |
Hashes for streaming_form_data-1.15.0-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6096bbf765c765258f6d20c8ecd12c3d6a720a3e55633a80e9ad54153054b83f |
|
MD5 | fe1d1124e1074dd96678127217c65007 |
|
BLAKE2b-256 | 0403ca4bb19a111cf409bbaf77c90b6be0f2ccff5e35326045bdc28d0154edc0 |
Hashes for streaming_form_data-1.15.0-cp310-cp310-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7a33759a85696a43459c064584969777a84ba3bda932b79cab971b09a29baf11 |
|
MD5 | f0232758f4684a64e016ab57234ff302 |
|
BLAKE2b-256 | f1c08a5214890e639624668f4417f6cdc3a682466f7024273b57e1d82d1c2420 |
Hashes for streaming_form_data-1.15.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5912818d2af4b8548ac6c2d2c3d0322065731f18216d394550abd4630dd97993 |
|
MD5 | 5301f826a3be0982def9c962ea22afb9 |
|
BLAKE2b-256 | cbd0888ef1d691d609f72c0a885a154ea62e6385fa12d96ac951fb06f2109836 |
Hashes for streaming_form_data-1.15.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 50c862b05300156a19a3c55f2ecaaf715e890d928c8fd2d9f10be150f67d1d27 |
|
MD5 | aae27373f1d9e593951d269aa78bad3e |
|
BLAKE2b-256 | 25d92bb2dfd0731b6c3bc9653604dcd639e2a4a77983698eb2e70008ea08f32b |
Hashes for streaming_form_data-1.15.0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a883f303bbd01423aa2d3317ff6c80641b6e9892308e11075d171352e75caf64 |
|
MD5 | 058e5cd5017cc60f34855978fe0046b0 |
|
BLAKE2b-256 | 922da861d96b319b7c3dadb2948a5df5286064e6025caca588b7cad169d60f4e |
Hashes for streaming_form_data-1.15.0-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fdcbbfc3f94babaeff4e95efb1b062feee75021a0a6239af5c6209d21b212ba0 |
|
MD5 | 6c053d4f754094549b3a192e4ed09934 |
|
BLAKE2b-256 | 8ac1553cbdfd31d710981c7fa8d49593a99266152ffb26d59b36c3bf76ccc22b |
Hashes for streaming_form_data-1.15.0-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 30ef2030bf1b22a705ba379d1958e9c103626ae9f037cbdfffe40dca5c529a89 |
|
MD5 | 8605e74fc279690089a956106611dcbc |
|
BLAKE2b-256 | 0ebdfa0d3f5fb4b478a8eedfdfc81beb3b6f9e135f81784162aa154e683b9193 |
Hashes for streaming_form_data-1.15.0-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0be4071c2414a82dd8e7c1abb9d36ff08c2c85fc5cc8ff644dc770bf708225f7 |
|
MD5 | b6c93a239ebfc576712acdba0fffdd1b |
|
BLAKE2b-256 | 6eab5fcb69cef708c06c44ce7e0e49693d32f7f24b38c192f10c9547db9fbc8f |
Hashes for streaming_form_data-1.15.0-cp39-cp39-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a3eeef08e437fab17444fc2c0a8299db31035b029d5c9a22ee2dfc4a58d7de3 |
|
MD5 | c42742e60ec9f3420c7d3811015e93f2 |
|
BLAKE2b-256 | 205c33b29a4e1f0021367c73adf357707c6d49bed520e131c1b1fb42b6d58c7c |
Hashes for streaming_form_data-1.15.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d59ca1a32fea68cab56906ca65942f850820997c693ec3446d6f91e578687a0f |
|
MD5 | 93f68b4f9ff96e36794c8c42c56d8143 |
|
BLAKE2b-256 | 696373273d31e4436c9e3af8966325d6a23abdbdc8c9d419024029b41a7042b7 |
Hashes for streaming_form_data-1.15.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e076ff1bd7acbfc8ea118ac08d5467b5aef1606c1bd719012f32edaa7a35490 |
|
MD5 | 3c23d021067faf0837a923f37eb366f3 |
|
BLAKE2b-256 | d0ee749385066bde85cf5fc34ed93abfcf63af56188b88cc1a51e52259ca1e28 |
Hashes for streaming_form_data-1.15.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2d3343abbcc9d41e727c4aeb084fa5b87e46cc5b72dd8811c7e204b379ca4d7b |
|
MD5 | d5a300a005909ca367a06307e0b323c1 |
|
BLAKE2b-256 | cdf1e39eef2170144d2db68debd99db83cd5db00291570fc40cd75c9c9b3ce36 |
Hashes for streaming_form_data-1.15.0-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ec3d34a196af6412518615855f707fb71d4271af5a0b0dd3a123b11f4de730a6 |
|
MD5 | 15853aab98cf009c57db91a53a2a36b4 |
|
BLAKE2b-256 | 739f5b9b8ccddf2f55cbf870ef32b49d8ed1dac43057880d23a6159e4fbbc843 |
Hashes for streaming_form_data-1.15.0-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 29312e70ed095b33bacee80bcd941328627d8f471f92f515e2aa7bfbcbe5bf43 |
|
MD5 | 94c43ee32ea0f82a0b0668a63c2f6b00 |
|
BLAKE2b-256 | 0ab200bbaaa7010dd41e4beda0eff48b032b95c0f043f46bf237c3b32628807b |
Hashes for streaming_form_data-1.15.0-cp38-cp38-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 900443d27c8f5c86a63ffe7019de1f8282f22363e5e2e921d16dc2372bb551b9 |
|
MD5 | 80548ccb823e25344dce57fa93aa2345 |
|
BLAKE2b-256 | 824c25e5f473e850c40e2ef7480979742906337956829a05bacbbfd83cdfcf90 |
Hashes for streaming_form_data-1.15.0-cp38-cp38-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2f20bc096d2328fa6acf91907e7106a9271f4b82b063691af084e98055a21361 |
|
MD5 | 108f39fd83bd48758587280bab495acc |
|
BLAKE2b-256 | 7f400cd220b172eec230c08729e094a5c40cefc7a20393521351a1c448c19154 |
Hashes for streaming_form_data-1.15.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0c0ecfa687b5b22e299a155351d646aab132e67b1c71c45e078a8800cb573358 |
|
MD5 | 5871b484b6ed060dd0037fc41e3e04f5 |
|
BLAKE2b-256 | 569d9fc375acb4cf18e393eef31388982f34b32cf8ff127fafe0bfaf729f45c3 |
Hashes for streaming_form_data-1.15.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 55aadcfdb342b0732cd3875a41cd39d688e44024f0ec48e931a82797089d3390 |
|
MD5 | b46b0aa410a1d069debebafbd417c7ba |
|
BLAKE2b-256 | f3ee874b13a956586e313e72ff2c350be64b37c37269b748e515bc1ec623f06c |
Hashes for streaming_form_data-1.15.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4fa2c947fcda4fc8fd2071e50fc75f111d3a9756b7d9b97b2665d7ab27d9eda1 |
|
MD5 | b589a8a89caca85fe6f73c3ebcaa54ac |
|
BLAKE2b-256 | 7f00b6eeb3901f288e0db7967b8b42ca008f5f0caa2ce6ff3c243f6b4260e4f0 |