Repository navigation
feat(python): add dfget Python SDK (#4421) - #93
Closed
DoubleCore wants to merge 2 commits into
Closed
DoubleCore wants to merge 2 commits into
DoubleCore wants to merge 2 commits into
Conversation
DoubleCore
requested review from
ClementMaH,
EvanCley,
Fricounet,
bergwolf,
hhhhsdxxxx and
mingcheng
November 4, 2026 02:53
….replace() Signed-off-by: DoubleCore <851678303@qq.com>
Signed-off-by: DoubleCore <851678303@qq.com>
Author
|
The PR labels need the enhancement label for the 'Classify PR' check. Issue #4421 carries the enhancement label per the issue description, but non-maintainers cannot add labels via CLI. Maintainer attention needed for label application. |
DoubleCore
force-pushed
the
issue-4421-dfget-py-sdk
branch
from
November 4, 2026 03:07
a3bb716 to
55d32a4
Compare
Author
|
Re-pushed with |
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
Adds a self-contained, zero-runtime-dependency Python SDK for the
dfgetCLI underpython/dfget_sdk/(implements dragonflyoss/dragonfly#4421).This is the CLI-wrapper approach: the SDK shells out to a locally installed
dfgetbinary viasubprocess/asyncio.subprocess, so it needs no gRPC stack and no protobuf codegen. It is deliberately complementary to #87 (which talks todfdaemonover gRPC) — the two packages cover different deployment shapes.API
DfgetClient.download(url, output, *, ...)->DownloadResult(task id, raw stdout/stderr, duration, parsed downloaded size, progress lines)DfgetClient.adownload(...)-> asyncio-native twinDfgetClient.version(),DfgetClient.health()(+ async twins)DfgetConfig(explicit >DFGET_BIN>PATH;DFDAEMON_ENDPOINT,DFGET_TIMEOUT,DFGET_LOG_LEVEL)DfgetError,DfgetNotFoundError,DfgetTimeoutError,DfgetCommandErrordfget-sdkconsole script withdownload | version | healthsubcommands and--jsonoutputTests
All subprocess calls are mocked (both
subprocess.runandasyncio.create_subprocess_exec), so no realdfgetbinary, Dragonfly cluster, or network is required:Notes
python/dfcache_sdk/package (feat(python): add dfcache Python SDK (#4422) #92), so the two SDKs stay consistent.python/.Signed-off-by(DCO green).