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 master
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.8.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 27ddc67333716a0b3a10f622e76a8ce5b9b7da124592c33e58405e55e2a7c357 |
|
MD5 | c7517e0e1f1390bbf5dd3fa91dd5f58f |
|
BLAKE2b-256 | a008d7b9a11cbb17cbd8957d6cd827dd65b042823ba3d1c11320a70fdb3b807e |
Hashes for streaming_form_data-1.8.1-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 10dc7791012ce72f73ec5fc5b0e1c44f2b505ea74c4b51f11af86affd45f6542 |
|
MD5 | aa783ec2e41a04fe6c6dce464f5f0755 |
|
BLAKE2b-256 | 507a34b2a2fdff8582cc4aa96e79263ea425fc220510b14b3a846a3bb56e3838 |
Hashes for streaming_form_data-1.8.1-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a5c6c0565ff36d2a48e6187d5f304c571adf45894ef7890caeecc6e633b8effb |
|
MD5 | fc3255028c3687060565c97e7a9ccba4 |
|
BLAKE2b-256 | d65b21cc42583fe6dadffb6ce2710a8179dcfeeb2ed8db2bedb0f0c0ebeb4b2e |
Hashes for streaming_form_data-1.8.1-cp38-cp38-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc7b5a4005941f4c01a5764cc7e0d8302c8e43e7ea216d078859fe35f0312101 |
|
MD5 | 89eae15b969777c14196ddbb8df20c8d |
|
BLAKE2b-256 | 9803224cd64030326cc84f736c144da9e89111ab94347f376cdeaa4d822d1b53 |
Hashes for streaming_form_data-1.8.1-cp38-cp38-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2ecdc996409df57542221731ee5e138c525a1d17502624229a5ebcd9c958811d |
|
MD5 | 314ea5e931df40c8d7d0c306a85d5c43 |
|
BLAKE2b-256 | 0d345a6f2b78c702f6bfd4ee2e9016a4d62c0add9e4d9dd0d8cfd6e3f67c9024 |
Hashes for streaming_form_data-1.8.1-cp38-cp38-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a6efe6f44cad4ddbdb786f14bbec6dcf874c66a8709a80bd0b876532722ea96d |
|
MD5 | 073167d8b823bda94ac01e610692a1c3 |
|
BLAKE2b-256 | 86272bbde504510cfca1972505c375070296f297c38f53fa5bdef23e6cb20ffd |
Hashes for streaming_form_data-1.8.1-cp38-cp38-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1204ab5953f2b323c091d658ae5eac093b9354f0e2d1878c5e6e324333b1bae7 |
|
MD5 | 4108d1bbedbb153ee7ac557896039bbb |
|
BLAKE2b-256 | ef461c8701547794f364005f0a4842bfa229f01595ee1bcd8a92147662184110 |
Hashes for streaming_form_data-1.8.1-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b6724ac87b45a04733428b93e32832be7309b31a91a51930de0f9fbb8934cfac |
|
MD5 | 1304e10c61e312274c8aea9afce83247 |
|
BLAKE2b-256 | f456dced3c52d081efc538f28bfa01ea39c7aaff345bf9714eb8a3be6f144cf7 |
Hashes for streaming_form_data-1.8.1-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a51f63687debc6e72a4774d7fd8ef26be005b952e9d480925a4c8657f3376f81 |
|
MD5 | 2cdecf1c34d0220244b836634f6b954f |
|
BLAKE2b-256 | e42b32f23b1d9210c4d2b94e29f629ebdf3e42403e618973fb7d0f4e0365ee67 |
Hashes for streaming_form_data-1.8.1-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3241c8df633c0f0faf243287dd5744122c36ec34a7b23f5726be836dbab1228c |
|
MD5 | 9822f980c5a4d29d85532c4ff05ce183 |
|
BLAKE2b-256 | 12dedd3a157e1869f910fcfc024c07f97461d3c988abf82b7abd571612b3908d |
Hashes for streaming_form_data-1.8.1-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ce7afcd6b14ce23f03abaa2d4715d0ad017b0b6e9974a49cb103e8f5b72bb460 |
|
MD5 | 6ce61ba727a886a6e5c13d5b4509823e |
|
BLAKE2b-256 | 43935eb3eb8f061ba7d37963961eb2a6168c9ca0f089e26d38223d574c5e2328 |
Hashes for streaming_form_data-1.8.1-cp37-cp37m-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2b776a3862237df36d9c35c44d70111ab8629ed03c5c9ef246fdbf5e8fee784f |
|
MD5 | 8504b8311563747a60b4c24a599a20aa |
|
BLAKE2b-256 | 0d9290f1e69aebcb72994b13018af4ebbd4e9db35f7bd031973412cfadec4f5a |
Hashes for streaming_form_data-1.8.1-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f2a975898a01ec0996268f75443b7c662c6e42058bf3d834a91b90f29a7e7cc9 |
|
MD5 | ce0141ab46e8790ed6945047fdea52b0 |
|
BLAKE2b-256 | 50ad454849816de4190fc1ed16a4cc8e691bdc8dede319e817317a37c127c9dd |
Hashes for streaming_form_data-1.8.1-cp37-cp37m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9108948c2a24b162f1177903c316120d9d4ac1b29eb4cea7798d4847bfda6edd |
|
MD5 | c03dba0392115c467d45f189f4e0c819 |
|
BLAKE2b-256 | 2a49066b14d1d4f4e598de6df4996e992e2a9e4a6856c1e8edbddd50ac93cb9e |
Hashes for streaming_form_data-1.8.1-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 89bd1acc156c4ee7e9a0e71595fe8d2f69d9c93de4274afecf0c498ce1af49d7 |
|
MD5 | 08fd7c24d1f42925bcd953dcf80c6a57 |
|
BLAKE2b-256 | aa14bbc0643607f71d93a3e6d2d4faa18618b5b36be14e5f82b4d1add82c8b20 |
Hashes for streaming_form_data-1.8.1-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8f25b775c0ca582adc0b1b26da38ed3630fd6cfbbdf6d1214cc0014ed810a8a8 |
|
MD5 | 266227f4cf8de6d561b6bf1c72c7465e |
|
BLAKE2b-256 | bdb3c65910203ca20947d62af7930ed4fd03aeb7d0c4b202abce4f0bdf866b95 |
Hashes for streaming_form_data-1.8.1-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b9bda787d807797b70d1e70fb0fe7161d8ca4665dd7ed75adc2767f4ad86e8a8 |
|
MD5 | ed2b5cdd53a5d1ee2d6a15e5a73f24a9 |
|
BLAKE2b-256 | 17c89452f142a8cbf96dc65c2db22152a46fbdefdb74371134eaf8c9d3c80ef6 |
Hashes for streaming_form_data-1.8.1-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2bb2f600f8b0ec8381cbee1b3e2af9c20363f572ee120b406f560a26b43f98b2 |
|
MD5 | d721e2e28be0afa2f0e1a32bbc7f0b6b |
|
BLAKE2b-256 | fb746c2d8d32afb378ba3267eacde0ae8018c7e299e0eafac63ef688e9c181e5 |
Hashes for streaming_form_data-1.8.1-cp36-cp36m-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 41fb937b57c1cb672083e450a390bc57accf0f57d6852c8c6e6bb4d402cc8fdc |
|
MD5 | 1a1d0cf43f228e5fbdf8a0cfb142a57c |
|
BLAKE2b-256 | 618b6794fbe00d26dbc147e65479f072efa7c9deb6aed5e1e7f133b6e6b8d8d8 |
Hashes for streaming_form_data-1.8.1-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1f350f3afb57eab1a1f33784a0a10be3fa9b5c7edd33e52900f5c5f522de41cb |
|
MD5 | 53aebb408b57402f160f45be0ac0a407 |
|
BLAKE2b-256 | d41d158e462c395fc641fcd8fd150d96704088868eba016d10c2e5f6ae9583c7 |
Hashes for streaming_form_data-1.8.1-cp36-cp36m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | acca1091bb9cc55fa19cd159d24e5da90862bdbeaa802618ce9473c54ed36986 |
|
MD5 | 2ac07a19233eb8023e43ebe9d555132f |
|
BLAKE2b-256 | 3341cd3570175a808f591ed14b623a25325f33637599d5850c0fcfadbc91dd5d |
Hashes for streaming_form_data-1.8.1-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3a1b431cd0842e0d4939636276f6d65f516ccec672a45e2db2db7bf55bdd94dc |
|
MD5 | 80a831fe732a0322ec413551d11aedea |
|
BLAKE2b-256 | 0e943c582feddb5fa6e524018094749db0b02ef14dc6f4a21604e9b7f1acbcc6 |