Metadata-Version: 2.4
Name: python-multipart-rust
Version: 0.0.32
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Rust
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Software Development :: Libraries :: Python Modules
License-File: LICENSE.txt
License-File: NOTICE
Summary: A streaming multipart parser for Python (rustsmith Stage-1 mirror of Kludex/python-multipart)
Keywords: multipart,parser,rust
Home-Page: https://github.com/Kludex/python-multipart
Author: Andrew Dunham
Maintainer: Marcelo Trylesinski
License-Expression: Apache-2.0
Requires-Python: >=3.11
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Homepage, https://github.com/John-Cusack/python_multipart-rust
Project-URL: Upstream, https://github.com/Kludex/python-multipart

# python-multipart-rust

Stage-1 Rust mirror of [Kludex/python-multipart](https://github.com/Kludex/python-multipart)
(`python-multipart` 0.0.32, Apache-2.0): a streaming multipart parser for Python.

## Boundary

The CPU hot path — the two byte-level state machines
(`MultipartParser._internal_write`, `QuerystringParser._internal_write`)
plus `parse_options_header`/`_parseparam` — lives in the reusable
`multipart-rust-core` crate (no Python dependency) with a thin PyO3
binding (`python_multipart._python_multipart`). Everything else is the
upstream source verbatim:

- ported to Rust: multipart + querystring state machines, options-header parsing;
- kept in Python: `Field`, `File` (file I/O + `tempfile` spooling),
  `BaseParser`, `OctetStreamParser` (no byte loop), `FormParser`,
  `create_form_parser`, `parse_form`, decoders, exceptions.

`python_multipart/` keeps the exact public interface (including
`MultipartState`/`QuerystringState` member identity and per-chunk error
offsets); the legacy `multipart/` alias package ships unchanged.

## Build

```sh
python3 -m venv .venv && . .venv/bin/activate
pip install maturin
maturin develop --release
python3 -m pytest tests/ -q
```

## Layout

- `python_multipart-core/` — reusable Rust core (`multipart-rust-core` on crates.io).
- `src/lib.rs` — PyO3 binding (`python_multipart._python_multipart`).
- `python_multipart/` — Python package (hot paths delegate to the core).
- `multipart/` — legacy alias (upstream-verbatim).
- `tests/` — upstream suite (frozen oracle; do not weaken).

<!-- RUSTSMITH-PERF:BEGIN (generated by `rustsmith release-prep`; do not hand-edit) -->
## Measured performance
No accepted optimizations yet (mirror baseline); re-run `release-prep` after `run --stage optimize` merges winners.
Artifact hashes are intentionally absent here; see `release-manifest.json`.
<!-- RUSTSMITH-PERF:END -->

