Add asyncio support to the Python SDK#57
Draft
kvz wants to merge 45 commits into
Draft
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## py310-v2 #57 +/- ##
============================================
+ Coverage 86.60% 87.95% +1.35%
============================================
Files 7 14 +7
Lines 209 980 +771
Branches 19 131 +112
============================================
+ Hits 181 862 +681
- Misses 28 118 +90
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Member
Author
|
Setting this back to draft while we expand the feature scope: the v2 PR should also cover the full Transloadit API endpoint surface before we treat it as ready. I added a matching @todo to the 2.0.0 CHANGELOG section so the release notes get updated once the endpoint coverage is complete. |
This was referenced May 26, 2026
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The API2 Python generator now converts contract identifiers to snake_case for local variable names, so generated methods read like idiomatic Python. No public API or behavior change. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The generator no longer emits function-local imports; base64, urljoin, and requests (sync only) now live in the handwritten module headers where Python convention expects them. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Experimental Status
Experimental work: this PR is part of an exploratory contract/generated docs and SDK effort, and is intentionally kept as a Draft while the approach is validated.
Why
Issue #9 asks for a Pythonic asyncio surface without changing sync callers. This PR adds a separate
AsyncTransloaditAPI on top of the v2 runtime/security branch (#56) so async users can opt in without affecting the existing synchronous client.This branch is also the Python companion for the API2 contract generator work in https://github.com/transloadit/api2/pull/7928. Low-level endpoint methods that the current Python transport can honestly express are generated from API2 endpoint contracts and verified byte-for-byte from API2. Checked-in devdock examples prove selected high-level flows against real API2 using contract-injected scenario JSON.
What changed
examples/api2-devdock-assembly-lifecycle/main.py, which reads the shared API2transloaditAssemblyLifecyclescenario and exercisescreate_tus_assembly,get_assembly,list_assemblies, andcancel_assemblyas ordinary Python SDK user code.api2-devdock-template-lifecycleexample that exercises generated Template create/get/list/update/delete methods against devdock using API2-injected scenario JSON and result assertions.createTusAssemblyfrom genericscenario.preparations[]andwaitForAssemblyfrom genericscenario.observations[]instead of removed API2 compatibility fields.transloadit.async_client.AsyncTransloaditwith async versions of the existing client helpers.Responsewrapper that works for both sync and async responses.aclose()/close().TransloaditAPI compatible with existing callers.api2-generated-endpointsblocks so API2 can rewrite them directly.Latest Verification
asyncio-v2is pushed at19186b1..tox/py314/bin/python -m py_compile examples/api2-devdock-assembly-lifecycle/main.py && .tox/py314/bin/python -m pytest.node api2/bin/cli.ts contracts sdks --no-motd --target transloadit --platform python --sdk-root ../python-sdk-asyncio --compare-existing.exampleCount: 3and Assembly lifecycle endpoint IDs present.core/bin/devdock.ts exec tstrun system/sdk_examples/python-transloadit-examples.test.ts -vv --max-time-per-test 900.19186b1passed across Python 3.12, 3.13, 3.14 on Ubuntu/Windows pluspython-e2e.This PR is intentionally based on #56 and targets base branch
py310-v2.Companion PRs
Transloadit
TUS
Allowed outward links from Transloadit to the related tus companion PRs: