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, 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.9+ 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.17.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1f40b10ebdccb37752374f486f750a808df807ad52a79f465420bbad2b896c50 |
|
MD5 | a89bb74e0792ae3bccefaeafbc0fc631 |
|
BLAKE2b-256 | f3c9a11a63821d4cf85358d9704930a85066d8df8c7bb8a7de071099815ca08d |
Hashes for streaming_form_data-1.17.0-cp312-cp312-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 77066fbc52d71eb69eb54e7c6bdf12feeee14aea6ab3e27d72e1d1e74f6f1a55 |
|
MD5 | 09606bc5d6e76c72ecd2f1d358a5e481 |
|
BLAKE2b-256 | 766d6a714654694908ea6d13a0cca24efde9092fdff77facfd7782baf76c39c5 |
Hashes for streaming_form_data-1.17.0-cp312-cp312-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4687be319e495dbb68610b38f6b1a0a4ce34e6edbc58e9d9d9adeaa1ae1306c0 |
|
MD5 | b439e19e7c61f7b45ae9cfc7f1b7620b |
|
BLAKE2b-256 | f99a81a6de0978be6c08b45346fd4ea89a744c39a157e6ac5c3dccef9f77f5e0 |
Hashes for streaming_form_data-1.17.0-cp312-cp312-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b6a266aa936489814a6e457ed6791cf6668b704eda9c46e4bc5c3a4a52ce8bdc |
|
MD5 | 9b97f2395384cacb7ce4bf50d2e4fa10 |
|
BLAKE2b-256 | 684fdfd85018924edbee050178d1fc3488ce824cb1f608777110421344e643cd |
Hashes for streaming_form_data-1.17.0-cp312-cp312-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8bc4cfab37b9484207491033c8c261f7cf32e1dc0714c50b7a3b7169e128282b |
|
MD5 | 5c97c60344eac210f212032dd3e796ab |
|
BLAKE2b-256 | 91562c2430bbba6771c2555236d0f79855683d30e4c9b2af54a268c6b0b24461 |
Hashes for streaming_form_data-1.17.0-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6b418a955f604078811fa0919fda51ef451cebc0e315a46c1c3c6e15e6306d05 |
|
MD5 | 4dd6d86cb4e2660137b4edb7ebda920a |
|
BLAKE2b-256 | e14e90cddabff3f88842ba34db2ccfb5d21f3c9aa017c299a56179323fc4c4e8 |
Hashes for streaming_form_data-1.17.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 56e18f672a390cd8749c48c1c63465378fe7ff2323d039b5014368f8d5d81306 |
|
MD5 | f5ef805755ec54017e5ba604d3bb1030 |
|
BLAKE2b-256 | ff2e1084728f1d937c552e97d0cd1c7db829ba24c5cd36a11c55d2d467438740 |
Hashes for streaming_form_data-1.17.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a1484b1f74bee6f19cde51fb697b6bedb0993f21e1f73d0ae76f8cd6947868c9 |
|
MD5 | c4ec5e459e74d882d7d15fa47ce13195 |
|
BLAKE2b-256 | 2785aa5b050aefa8e44e13ee561c3b88ca6705822b650cddb64e85b85d1daf1b |
Hashes for streaming_form_data-1.17.0-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eef5b3b274c7165485c2160b47597489db9e835ffe67602357dac8e882af72ae |
|
MD5 | 27fd3353487f147c75dd9df524ab78ab |
|
BLAKE2b-256 | 729f14ff0a107c3cb4824dde770f32f25ba05f0545982b63eef569b1a02f1970 |
Hashes for streaming_form_data-1.17.0-cp311-cp311-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 47bd455bb350f1e788c2e5bcbf80baf19941047e34e1a2dce14f3e142b297108 |
|
MD5 | df69485d566ed2e9c82c22b97cfa8439 |
|
BLAKE2b-256 | c1dc0fc31b43d6cc0a58167d00f5e945cdd993ecd92559eed33b7306148781d0 |
Hashes for streaming_form_data-1.17.0-cp311-cp311-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fb4b4cb15f1e3a1c3bfd83bf2a36be9a266657e60bb68f8272ce64b479c47bdf |
|
MD5 | 83010488b859d0f290553c65f0a3f982 |
|
BLAKE2b-256 | 1ddc2fc36dbf0d6828b6ea7a3a9409c4e08a5029213f7eeef6143a556d76d8ed |
Hashes for streaming_form_data-1.17.0-cp311-cp311-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 445bacae65503cc0f1ef3094ad8a82ed757312c591f155001e0133ce5dab45c6 |
|
MD5 | 05def5d2a9ed486519362baa4ad80368 |
|
BLAKE2b-256 | 226f4ddc050d362b970b32dd3163eb257578de2ecfdbc0b4816a115ff4d91e69 |
Hashes for streaming_form_data-1.17.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 30c445cef552158310e1745dd12fa85841e1c2b4a6125161a54b25e109f3b477 |
|
MD5 | 68e167a696fd6a3571e7b78ce3419809 |
|
BLAKE2b-256 | 6cc78ff2ccbb47be81eac3fcd9a1f34bf996127b45fc3fa79a3403316d18239c |
Hashes for streaming_form_data-1.17.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 905f064273db82bc104ad9a8d5708ebe638486ed5e608f357bfd8f9805216216 |
|
MD5 | e03203d19956ee23920a85c7b591eb0a |
|
BLAKE2b-256 | 7f80180e1d31eb011fd431aa0a82a3e797ac01f1ce7285949cd4c71be878dc88 |
Hashes for streaming_form_data-1.17.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d34ab619900f16ea36758c84f1f21d56a6a85a48073fd78ff94436d884f4c79b |
|
MD5 | b4c5aa8eb66781016dcba826bd850d7e |
|
BLAKE2b-256 | 530ffb47c49e8acc370f9d472f93191f3d1a8b531e8b50205e5b32997141c73a |
Hashes for streaming_form_data-1.17.0-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1af79d623e2c05fef1a0fdb52a11164ad192847ab1077eee1774dcbd8bae2eb0 |
|
MD5 | 0a6565ac14457e2748da746101e9361a |
|
BLAKE2b-256 | dee3f942c4581e08c60112af696aa8225eb98d163b56c7265d7d5fe34f460424 |
Hashes for streaming_form_data-1.17.0-cp310-cp310-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1abac52b3cf8eea17e76c03eb59b37ffe6cc32d57b3598727a71da65967ddace |
|
MD5 | 90e7e1f05a34a6088c692bc6c6f095da |
|
BLAKE2b-256 | 2d732da63fb03010c5953fae8980f535260dd8ca6840d056a9eec04b764ebcde |
Hashes for streaming_form_data-1.17.0-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f0ce7f34432383750f0daff2142ab2e7e05f7ffce225528b571a296539f81d43 |
|
MD5 | ba35100f6cd457704e6c6bee7a6115d6 |
|
BLAKE2b-256 | dd7a0d655abd50b08a9ee63ed9ef67ff1fe3eb2510a31b3e9a331dacd58cd760 |
Hashes for streaming_form_data-1.17.0-cp310-cp310-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2c019f005781cf615d564676c379455845525b400771c7df5beba0d3308a0e9f |
|
MD5 | 6995f7bd3b46d447e8fd88f44f0e974b |
|
BLAKE2b-256 | 8587d0d7a8d0ad3da4391071b22247421408bb35f3c807992f323f0a89a90fc5 |
Hashes for streaming_form_data-1.17.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b34a5885ac104645b8d1f5ed76cb9964ed770f1a23a8715a23e1b4e80ccacca |
|
MD5 | e3e172c2b11089eb3046381bf07f79b7 |
|
BLAKE2b-256 | 4de4163999f79eb336d69f29ff526d314e8b9f5c70673b5839aa8ebe325befeb |
Hashes for streaming_form_data-1.17.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 43eb9eb832bad255b7be34942e0c1272d23f694e84893db051e3f5a58e4fd628 |
|
MD5 | 50a7beca069f335b0a8e03d255b7ad80 |
|
BLAKE2b-256 | 894a0455821ce8c692f21c0b37c22c10d466158b7eed0a87ac85a505fbe4d7a2 |
Hashes for streaming_form_data-1.17.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 76b7c27fe3488d345e21e106eef88bec1be9ec35e1a2eaa310d5a2dfb493c005 |
|
MD5 | 67a3fe20edcffc8508998c15dc1436db |
|
BLAKE2b-256 | 2b43f66b2aab314b1559dd15e234b9c0c356e7d98213082a259678a0c5bb87cc |
Hashes for streaming_form_data-1.17.0-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2bf404fc906c3e6dcdf9731779f11c01eae64db13711df09355c7bd628f20102 |
|
MD5 | b60c488a6fa0119c5205a265851b3556 |
|
BLAKE2b-256 | 6c2b9f72b76163ee2dc0611fedf1e2069c38f512fb0ce558c82a0bfa9449acc1 |
Hashes for streaming_form_data-1.17.0-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 150b99bcbaab54b8636e62a9a70bb019b2da2c277b2685904c2cc3030fbcdb5d |
|
MD5 | c1d8c260a92617d1b82f937e55abb078 |
|
BLAKE2b-256 | 7c2e811043bdefcbcec2671c1edf7c7d870651e0e26508fe18a9e54330b39ee2 |
Hashes for streaming_form_data-1.17.0-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2211222ee81db17cd10f7a879e395c818a81721a10b2fea04dbc294e0b21ac41 |
|
MD5 | 1443dac464cb89a6f4a2a470d99772e7 |
|
BLAKE2b-256 | c3270db14aef2d6483a0ec5cf36f5670a3b43592c5124ea4567bda3511bccdef |
Hashes for streaming_form_data-1.17.0-cp39-cp39-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cba6eea07ab5f8c835b998ca6aa28d7cd2072cabf5c7fefbf0cdc6f332488902 |
|
MD5 | c6854e6c87e439d655f6b3d9c198646d |
|
BLAKE2b-256 | 59e25df2e8d64bd6e79735e16eba427476bac74f79d8a5d930b00d9debbce393 |
Hashes for streaming_form_data-1.17.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 63d4d4aae52498186933b5974ece4963830f5e4d84880bca1e5bdd859ff982f7 |
|
MD5 | 03609640e2929cb3b38f5b6c6f966110 |
|
BLAKE2b-256 | 94ee5d590878c958ad1dadb137a3c417c5173be8b3ba07f9073a64993a66ffbd |
Hashes for streaming_form_data-1.17.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e0352e6f0a5f19fc1122cd46446421f65cc96915a7e6bd15d89c0cf29ff980a7 |
|
MD5 | b072abf7ddbf7130bb3debd03ce3b16e |
|
BLAKE2b-256 | 154eee56caf84d798611b45070d9980e9cd3cc0a5ca73d09ae1d93970af7fcb4 |
Hashes for streaming_form_data-1.17.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a0f6f103f2ce657c26a03224185466f2b6caffbf985bdea3ffadaeeba7a196f |
|
MD5 | 57f40c86f68224f8f65f7a9f2a70494d |
|
BLAKE2b-256 | 0d8da81f19a9a74106794c8979931b75bffe4cee87d969b4ae4b643017a58cc8 |