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).
Installation
$ pip install streaming-form-data
In case you prefer cloning the Github repository and installing manually, please
note that develop
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.6+ 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 -
pip install -r requirements-dev.txt
-
That's basically it. You should now be able to run the test suite -
make test
.
Please note that tests/test_parser_stress.py
stress tests the parser with
large inputs, which can take a while. As an alternative, pass the filename as an
argument to py.test
to run tests selectively.
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.9.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | dc291132e44a758758b3fd0b4c99fda27d93934a4e3207a3012ef1d3c28963e4 |
|
MD5 | 9d3f13574cf7641cb0ff6b1df7d7852b |
|
BLAKE2b-256 | 8ec935cd71c7b1afbea8a7132081cb32a44c476f3bf9936137afe17c01ab6daf |
Hashes for streaming_form_data-1.9.0-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3060029180a86a819297797decc6b7012c1353c298b54309cd9670263668b981 |
|
MD5 | 4181d4bf882cb9ee48c78a2b726f455b |
|
BLAKE2b-256 | 54e31f2d3fd6e7c28d7269c756b1d379ae74946a01ee36ea50d6c821887667fd |
Hashes for streaming_form_data-1.9.0-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ba420527b0bd076e2eb3678e5d5cd38c22991397e80df382742356533277a822 |
|
MD5 | d401e07112cec0be035da2821a7f54e6 |
|
BLAKE2b-256 | e34444d139dfe83923b7fb6404204a7278f5395a7ed1afc530afd19648fd81a4 |
Hashes for streaming_form_data-1.9.0-cp38-cp38-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0b99e34873fe3b366fcddf1505597cc5f1acfdc8444efa4e7e32ee589093c10f |
|
MD5 | de76dd573f2ce0549a60e82eddc967a7 |
|
BLAKE2b-256 | 2fd64c4e58d78bac13dc4e5c349ae86435621227e65a39692a4b47cf39d3ac55 |
Hashes for streaming_form_data-1.9.0-cp38-cp38-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 633e38097799aaf8f29cd13f7a8f62945429e0b9a9d28112f715482524728d8a |
|
MD5 | fcbefedf991bbfc43611b5af377d4ee4 |
|
BLAKE2b-256 | 039ae5bf0fed63215fd343815b4775526d062f4dfafada649fcf3a101c2d0ab7 |
Hashes for streaming_form_data-1.9.0-cp38-cp38-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ef6f922959f4f7fd76f96815dad525d195f80537405297afac4b059a5ea0876 |
|
MD5 | 48dd70d63c9ddca999bbe786d28fbf1d |
|
BLAKE2b-256 | 07bd8f6b488743e9c6ada6186cdcf6e889ff86f1cece14499cb729e32a782cd3 |
Hashes for streaming_form_data-1.9.0-cp38-cp38-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1ed9e633245b6cd359f8be438698cd614f91a83bfb14617974fc65444ab5f39f |
|
MD5 | edfed2f7f962706be2725b0b6f17641c |
|
BLAKE2b-256 | 6c92d18e1830e1dcf7a9420708e583f777a7c4b3e4e502db2ef2c9ddc68b4ed0 |
Hashes for streaming_form_data-1.9.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 613442d2d5c7d355593080fc4499ad217714284f57535a8647cd53bce1cb1ac8 |
|
MD5 | b8acf822959d5f324ee68ac29b6660df |
|
BLAKE2b-256 | 5a1da3ccc8b47388296d4616a3aeb4deebd4c8477d521b483fbb37546dc9b18a |
Hashes for streaming_form_data-1.9.0-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e904459d3b775d2511f2a34ecb981ab234a5eac7deda4c32650e17878fc8b43 |
|
MD5 | e064bac6817c67b7298c72beefaa7c0c |
|
BLAKE2b-256 | 6737206ca84e0a249faacd2cb0ba54a9f174eadc3ed34e37d78c1e2219b64df0 |
Hashes for streaming_form_data-1.9.0-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cd342132ce7bf6774ac69aa0f6c6388e4a12bb91690f23094ee184ef9c54d4ff |
|
MD5 | bba04cd62cc25ecda5c8aee19142049a |
|
BLAKE2b-256 | ba53d72aeed2f1ca5b528f3af41292b93b520aba1f1961ead7e474993c39c69a |
Hashes for streaming_form_data-1.9.0-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6b08f269e809303ae627486bb374a8c0cd2b9893990debbec8773f4dd9d6a20c |
|
MD5 | a70eeec6476dfe4248977cd8b07385bd |
|
BLAKE2b-256 | facbf8f608014b9b4220688a4a15f97576c6ffa9e7dcd290063a1f4a9ded634a |
Hashes for streaming_form_data-1.9.0-cp37-cp37m-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a9736f65025b450f029ca4166bdc4c51996010c1a51f1d56bcacedea446fe646 |
|
MD5 | 06751c6ef333df3a7afe925583cd6b71 |
|
BLAKE2b-256 | 002b8446c86f5f2085d3cf9e94d1f903e38d6752546e9afbfd3771578ca10f9c |
Hashes for streaming_form_data-1.9.0-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c81c4a5414dce00cead02c4466b473a76a2e20aea494c9d2114075c4a1571a03 |
|
MD5 | d73a7603b9cc91db08b5a42a74c75e77 |
|
BLAKE2b-256 | 2a57d915b8fb549a5757e77587f3ef37f7edbc3f7a4d98846a9c8dce48a21f5e |
Hashes for streaming_form_data-1.9.0-cp37-cp37m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 64399853e650641c37e0fb2baa259956675a544e6dba917ec8c72ecdddfc5a11 |
|
MD5 | 581b31293d38dd027605c767c3ff21d4 |
|
BLAKE2b-256 | a2eed0750d3bbff21017312252226b3dd19b60d844b2b1976fc0e686f3175015 |
Hashes for streaming_form_data-1.9.0-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8ee5647356e38a41e5b228e2797d0617fbe8207d79016d6a7057b27f049e5a22 |
|
MD5 | 9069c0845c5071d2c20bee5d5ee01f6b |
|
BLAKE2b-256 | 17d9254d30da146ea57b7fbc9b53b48cdaf8449abe2fdaab66473d7456f34897 |
Hashes for streaming_form_data-1.9.0-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b9bbc1427afee5f81482ef8bdbb5fa8bd2fcd5bf46f74fa1fe3c3fa0060671c4 |
|
MD5 | 711adf9ad01706e366915eeb3fcb03ee |
|
BLAKE2b-256 | 78484bd0d8ec0376573674b5d1bff4f87d85b44c2946f6a495560f46d262e423 |
Hashes for streaming_form_data-1.9.0-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2fd1487c7b8022bff4521a4663c8704cb45e59b10908396acce2aac3e0cf2efb |
|
MD5 | 3ad715eb0c184f635eb8c1e239242a20 |
|
BLAKE2b-256 | 76b9cff5c125bde7c7745e130a28eaab3aa423f97125e55adf2f6bead3db3c7f |
Hashes for streaming_form_data-1.9.0-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 75aa518c8a0226571d328bf95938e1f1224765aaaa675041e0ffa1c3cce47cc1 |
|
MD5 | 2dbddb65753bcad5e14f8d2c5c6d08a8 |
|
BLAKE2b-256 | 9b88d3a5b7ecec5093b5c4de478a7258d39bdf0005f5c5eb95f17882e855a7b8 |
Hashes for streaming_form_data-1.9.0-cp36-cp36m-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6100eaf1bc7329256285f3a38a3c84622a624128ff29dcafe98a40792101d30f |
|
MD5 | 4cf3545b6e720087156e98329df1dd0b |
|
BLAKE2b-256 | 9959aae3ef27a336863827d6ad159b1f725b450dc73ae772c5491104ffd7adc9 |
Hashes for streaming_form_data-1.9.0-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5193da6385341d352005c7f9bbf4d3fe17171cd26c0b64136476c2185402f00c |
|
MD5 | ec7bc4a576508e841db6d12ed045c133 |
|
BLAKE2b-256 | 32f9627da1ffb954dede237364456672238f2d9fbde3b0064fbb540373b45fa3 |
Hashes for streaming_form_data-1.9.0-cp36-cp36m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fe807e668148272dbbe31aee57ae17b24d3cfb85ae90de1d5d0122a05d286ebd |
|
MD5 | a42d5e72f9371d193959d48cfb4de3c2 |
|
BLAKE2b-256 | 91f6477c4226c79ceb5f672e4ba3517e1109172381f596258cfde6f6c628858e |
Hashes for streaming_form_data-1.9.0-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 58d8a63d5e37f81a320784d7ebce1da3928b4be963985b636c0ea5f515f75bd3 |
|
MD5 | 435be285d40edebbc2675871bb030a67 |
|
BLAKE2b-256 | 935b0fa9eb2eff75180e5f085844a7237ad755e4bcdfb797e4f0807977d32f0a |