Skip to content

Add multipart file upload support - #16

Merged
johnbrandborg merged 1 commit into
mainfrom
feature/multipart-file-upload
Mar 10, 2026
Merged

Add multipart file upload support#16
johnbrandborg merged 1 commit into
mainfrom
feature/multipart-file-upload

Conversation

@johnbrandborg

Copy link
Copy Markdown
Owner

Summary

  • Adds a files parameter to Client.create() and Client.update() that enables multipart/form-data uploads via urllib3's fields parameter
  • Accepts all urllib3 field value formats: 3-tuple (filename, data, content_type), 2-tuple (filename, data), and plain str/bytes for mixing form fields with file uploads
  • When files is provided it takes precedence over data and serialize; when omitted (None default), existing behaviour is unchanged
  • Version bumped from 1.5.0 to 1.6.0

Files changed

File Change
src/cruds/core.py files parameter + _FieldValue type alias
tests/test_core.py 7 new tests (100% coverage on core.py)
docs/user_guide.rst New "Multipart File Uploads" section
README.md Feature bullet point added
docs/changelog.rst Release 1.6.0 entry
src/cruds/__init__.py Version bump to 1.6.0

Test plan

  • make lint — clean
  • make format — all files already formatted
  • make typecheck — all checks passed
  • make test — 151 passed, 99% overall coverage, 100% on core.py
  • Tests run with -W error::DeprecationWarning — zero warnings

Made with Cursor

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
johnbrandborg force-pushed the feature/multipart-file-upload branch from 3003d7d to 5001334 Compare March 10, 2026 12:02
@sonarqubecloud

Copy link
Copy Markdown

@johnbrandborg
johnbrandborg merged commit 26faf21 into main Mar 10, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant