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 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.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.11.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | d5125762448010b71a51b083f8a17591658f55625f977ca2e00978e6ffbb1f3e |
|
MD5 | 9332f1081e8905ea6854889065372d22 |
|
BLAKE2b-256 | b8e3c2edd5fe7eb84bf9a1dbda7527606998daa6b142f8d5c6e081ab4eb26700 |
Hashes for streaming_form_data-1.11.1-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eed528aa8c257b3bbc8d21dc05e664c172c2cbae7b7d695d75c604c6337457f0 |
|
MD5 | 0d91027781f989c1fb7e2d66408f11b9 |
|
BLAKE2b-256 | 36fef21c7c7dfca8b59daa1a4d5ccff7ed755d03d46320a45b2e655966f4eb01 |
Hashes for streaming_form_data-1.11.1-cp310-cp310-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d2903cd8a7c506e4bb961d7a29926904e5c15ce4aa9855a117d605a8cb93c606 |
|
MD5 | 421220d3c0101e5adedbac73584bc954 |
|
BLAKE2b-256 | 41d43436a81052fed804081f8423c2fd08beed7986a438fb8015785b1da99a99 |
Hashes for streaming_form_data-1.11.1-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b629d72d9a7f148c2dcaa489e5dc5cfa7adb3db7b665b6c4f3b3e8471ea4866e |
|
MD5 | 5f8bb966f70b79fc34c4e444dccde0a2 |
|
BLAKE2b-256 | 0bde5d9408ce27eac026623882916775824abc8dfdb7960287e580957a1a5850 |
Hashes for streaming_form_data-1.11.1-cp310-cp310-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4612fd1f86acec14226462946cf09f0984fa4cca643a4db661fe4e663d4d14cd |
|
MD5 | 8d911dc552e53644a8bd93e5d51d1dbf |
|
BLAKE2b-256 | d9978b4fa30046b76e161723bba48a91bddbbb5073c1aaf3b7c31e49bd5cf613 |
Hashes for streaming_form_data-1.11.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | da40f15a6c4012edbf4cf472e0fdca4de64dcc9e10baa79165f825b8f2f20992 |
|
MD5 | 3411253f65dce0519bc328cdb2e27bcf |
|
BLAKE2b-256 | a5745b0104b7457d607888b52c313738477313c3d22fd991ff66ed7b775fc30a |
Hashes for streaming_form_data-1.11.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 00b2e94e2c08a865a375a61d3de04a45ad5d1aa96589f6c45b391a589309743e |
|
MD5 | 8277f2b4a11b4e6558186aec68fe5e77 |
|
BLAKE2b-256 | af9b756db07c2392d1840f5f679591f8969b233c98bd6e5517d9a427fd6cd27d |
Hashes for streaming_form_data-1.11.1-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e32594653a28aff5acdd6f99b8347ce428c78842e3b180539ba4d6dc6ad4720c |
|
MD5 | 4cb3012d5d457dd55423e8ed37e2cded |
|
BLAKE2b-256 | 128bbe2f931c990022f5124cc1e6241b900149630bff32a7853b5de634bb7146 |
Hashes for streaming_form_data-1.11.1-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 271d347439391aa8c84fcc37a03d960a0141361a80104eb0525846598f51905b |
|
MD5 | 7462f752f2c779126d9beb02da03b8d2 |
|
BLAKE2b-256 | 2f9139fab6681dbfe50197a222dbb91e64bdca50c8935d3c468a220ca60e0990 |
Hashes for streaming_form_data-1.11.1-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 54822961bd900fa157d126a0952ec01a156976f38293f37e2256f6a4722d787a |
|
MD5 | 47611dde8d1df7f0f40ca69d695cefc0 |
|
BLAKE2b-256 | 36c51c43c3dfb9b36fb8982fe1edd875aadae0e0ac28992f2f13b2621aed4bd7 |
Hashes for streaming_form_data-1.11.1-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 13b4607c0201b53b8f2d473285fa83497c7b7cbe01f851899999cb978c28326a |
|
MD5 | b566b1baa49d3125c2f4573e523cf2dc |
|
BLAKE2b-256 | 9fd2a7a35d7f9dab4d6e1b7efd76c3d09e9cc8e6146e17225b30cc822a74d9ba |
Hashes for streaming_form_data-1.11.1-cp39-cp39-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 49327ef1e6baddecfe425c8ae98bb9062e43ce4497d58941a63032d7d6e2bc0f |
|
MD5 | 803c436baafe9e114887501e3247e3b1 |
|
BLAKE2b-256 | c154d24097bdbd072300222955eb2f3cfa2c4ba14e0248216a287eab60ba4f29 |
Hashes for streaming_form_data-1.11.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 691814847d46f5d8365040427bcaa3648e0bbac5dd24551aaf7c13ee58de7ded |
|
MD5 | 19a64dbb97d24d36c444d4d2158a2cdf |
|
BLAKE2b-256 | 0b1d0e87fdd777fd3cfe139ec35720e4aef4ac673b4a9a10f4c360ccf576178c |
Hashes for streaming_form_data-1.11.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1179056d25c2577d4a0831cc56c3accd03f6a2c913e45a3ab53281e0ba2424bf |
|
MD5 | c1b7f4569a02048fdc9b26faa0950f4b |
|
BLAKE2b-256 | 07ce7c7006145a48f7c7612907c640a1bc2018f763323895c9aa650755946fbb |
Hashes for streaming_form_data-1.11.1-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 050db0e4229454dea9627511d65d568e41ab770a02d0375d3e90e80ed84a4439 |
|
MD5 | 630f6f87d541eba0c30146c0a9cc10a3 |
|
BLAKE2b-256 | b74d70b742f7df590dd8d1eb0a3e943ff9e16e3746da4e50dc5d99b8d8b30fc3 |
Hashes for streaming_form_data-1.11.1-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 38bfff98f81291b29702c19d7fbb15cefa70acab318b890a80a092cca1a9b411 |
|
MD5 | 22db14348bf73a13aa76612ae86f1edf |
|
BLAKE2b-256 | 9ec614d0622c9924da79b1f65c83cb449f96ebf5ddb0820403909973e039fad9 |
Hashes for streaming_form_data-1.11.1-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6fc84c655a6d0f116920e276ff6ae7a3f1db4b32b38cd37e753388728ffdc7cb |
|
MD5 | d93b2a19b8d5d314c0e94356a4c9316b |
|
BLAKE2b-256 | da275da26abd6d9e4b038348b0594ceddbdce9811fefd08af4ae1ce361310cf7 |
Hashes for streaming_form_data-1.11.1-cp38-cp38-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dfe9f7d1cec648a55498b793fd20f2827792ce1a7c37cc48bb0f5f31f9c9f148 |
|
MD5 | 65507e64adc3fb35dfbd0138ae498bd4 |
|
BLAKE2b-256 | 578dc24bbbcfbd02d8b41b14ec382b2f8c711cc7cfe49b5d33a6f2990fdf96d9 |
Hashes for streaming_form_data-1.11.1-cp38-cp38-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b2cee5e663267248f3dedbcb4ae87667746fcd3d63c328ce2e0e1888729a6bf0 |
|
MD5 | db755933d9d4daada7e18885790d3f84 |
|
BLAKE2b-256 | 871dbdc499a7810d9bc32d9d11fa4a6782adc36a7d0f7205c47a5c00519e257f |
Hashes for streaming_form_data-1.11.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 73259470394ba65031fa120ff73e24f8930c3170ca50d83729f00e5ee54f8b86 |
|
MD5 | 03c8b1c2118299ac3fb2371cf5113120 |
|
BLAKE2b-256 | 67be035d1f5dcc86f8bc2809397d7ef54ec96e3a2d1e7d8eb915f4cbd8363ab3 |
Hashes for streaming_form_data-1.11.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4ff368fff91efdaa7314c03a3b721d7ca7dd52a348c656018895d20ea20d6b30 |
|
MD5 | dcfe500599646ea97fa9cdb15329a809 |
|
BLAKE2b-256 | 989b9cd830b68ff242062cdb1ec107d5036345ec4f2fbadb716bc6c9a8c3005f |
Hashes for streaming_form_data-1.11.1-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3a588fffd2b9e4620c5bda69956825752c45b86f73b2eef62c908cee346d302c |
|
MD5 | 43df67257445730f70a6d2a4a2a80438 |
|
BLAKE2b-256 | 470a874c45a14b3bc3d73fdf337b5d2ef17a1a5ba6dda7b86265e950244e1a77 |