Skip to content
/ parser Public

Sans-IO parser for RFC 7578 `multipart/form-data`

Notifications You must be signed in to change notification settings

Kludex/parser

Repository files navigation

Rust Parser for multipart/form-data

Warning

Disclaimer: This is a work in progress and not ready for production use.

This package provides a Sans-IO parser for RFC 7578 multipart/form-data.

Note

This package is heavily inspired by defnull/multipart.

Installation

pip install multipart-parser

Usage

from multipart_parser import MultipartParser, MultipartPart, Field

parser = MultipartParser(boundary=b"boundary")
parser.parse(
    b'\r\n--boundary\r\n"
    b"Content-Disposition: form-data; name=\"user\"\r\n"
    b"\r\n"
    b"Potato"
    b"\r\n--boundary--\r\n"
)

field = parser.next_part()
assert isinstance(field, Field)
assert field.name == '"user"'
assert field.data == "Potato"

Contribute

I run the project like this:

uv run maturin develop && pytest -vvvs

License

This project is licensed under the MIT License.

About

Sans-IO parser for RFC 7578 `multipart/form-data`

Resources

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published