This library includes an ultra-fast Rust based multipart parser. This parser is used
by Starlite
, but is developed separately - and can of course be used separately.
pip install fast-multipart-parser
The library exposes two functions parse_content_header
and parse_multipart_form_data
.
This function is used to parse a Content-Disposition
or Content-Type
like header into two components -
a value (string) and a parameters (dict).
from fast_multipart_parser import parse_content_header
result = parse_content_header(b"Content-Disposition: form-data; name=\"value\"")
# form-data, {"name": "value"}
TODO
TODO
TODO
All contributions are of course welcome!
- Run
cargo install
to setup the rust dependencies andpoetry install
to setup the python dependencies. - Install the pre-commit hooks with
pre-commit install
(requires pre-commit).
Run poetry run maturin develop --release --strip
to install a release wheel (without debugging info). This wheel can be
used in tests and benchmarks.
Benchmarks use pyperf. To execute them run poetry run python benchrmarks.py
.