feat: add initial implementation of Dragonfly Dfcache Python SDK with client and error handling#4448
Open
mdxabu wants to merge 1 commit intodragonflyoss:mainfrom
Open
feat: add initial implementation of Dragonfly Dfcache Python SDK with client and error handling#4448mdxabu wants to merge 1 commit intodragonflyoss:mainfrom
mdxabu wants to merge 1 commit intodragonflyoss:mainfrom
Conversation
… client and error handling Signed-off-by: mdxabu <abdullahfakrudeen2020@gmail.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4448 +/- ##
=======================================
Coverage 33.47% 33.47%
=======================================
Files 351 351
Lines 35325 35325
=======================================
Hits 11824 11824
Misses 22606 22606
Partials 895 895
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
gaius-qi
requested changes
Nov 12, 2025
Member
gaius-qi
left a comment
There was a problem hiding this comment.
@mdxabu Please generate python code by proto definition in api repo,refer to https://github.com/dragonflyoss/api.
Author
|
Sorry, can you give more details? |
Member
@mdxabu You can generate python code in the https://github.com/dragonflyoss/api repo, and base on https://github.com/dragonflyoss/api/blob/main/proto/dfdaemon.proto. Dragonfly needs depend the python code in https://github.com/dragonflyoss/api repo. |
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.
Description
This pull request introduces an initial implementation of a lightweight, unofficial Python SDK for Dragonfly's
dfcacheoperations, targeting AI and data workflows. The SDK wraps the existingdfcacheCLI to provide a simple Python interface for common cache operations (stat, import, export, delete) and includes basic error handling and health checks. It also sets up the project structure, documentation, and basic testing.Key changes are as follows:
SDK Implementation and API:
DfCacheClientclass indragonfly_dfcache/client.py, providing methods for stat, import, export, delete, and health check operations by shelling out to thedfcacheCLI. Includes error handling and binary auto-detection logic.DfCacheError,NotFoundError,DaemonUnavailableError) for SDK error handling indragonfly_dfcache/errors.py.__init__.pyfor easy import.Project Structure and Documentation:
README.mddescribing features, usage examples, design, installation, and roadmap for the SDK.dfdaemon_cache.protodocumenting the subset of the Dragonfly daemon API relevant to dfcache operations, as a reference for future gRPC implementation.Packaging and Testing:
pyproject.tomlfor packaging, dependencies, development tools, and test configuration.test_client_basic.py) that uses a fake CLI binary to verify the main client operations and error handling.Related Issue
Types of changes
Checklist