Add multipart file upload support - #16
Merged
Merged
Conversation
Adds a `files` parameter to `Client.create()` and `Client.update()` that enables multipart/form-data uploads via urllib3's `fields` parameter. When provided, `files` takes precedence over `data` serialisation. Existing behaviour is unchanged when `files` is not provided. Includes user guide documentation, changelog entry, 7 new tests (100% coverage on core.py), and version bump to 1.6.0. Made-with: Cursor
johnbrandborg
force-pushed
the
feature/multipart-file-upload
branch
from
March 10, 2026 12:02
3003d7d to
5001334
Compare
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
filesparameter toClient.create()andClient.update()that enablesmultipart/form-datauploads via urllib3'sfieldsparameter(filename, data, content_type), 2-tuple(filename, data), and plainstr/bytesfor mixing form fields with file uploadsfilesis provided it takes precedence overdataandserialize; when omitted (Nonedefault), existing behaviour is unchangedFiles changed
src/cruds/core.pyfilesparameter +_FieldValuetype aliastests/test_core.pycore.py)docs/user_guide.rstREADME.mddocs/changelog.rstsrc/cruds/__init__.pyTest plan
make lint— cleanmake format— all files already formattedmake typecheck— all checks passedmake test— 151 passed, 99% overall coverage, 100% oncore.py-W error::DeprecationWarning— zero warningsMade with Cursor