Skip to content

add python grpc client#119

Merged
kacy merged 4 commits intomainfrom
feat/grpc-py-client
Feb 14, 2026
Merged

add python grpc client#119
kacy merged 4 commits intomainfrom
feat/grpc-py-client

Conversation

@kacy
Copy link
Copy Markdown
Owner

@kacy kacy commented Feb 14, 2026

summary

adds the official python client library for ember's grpc interface. thin wrapper
over generated protobuf stubs with an idiomatic python API covering all command
groups: strings, lists, hashes, sets, sorted sets, vectors, and server commands.

key points:

  • EmberClient class with context manager support
  • password auth via grpc metadata headers
  • vector ops accept list[float] — protobuf sends packed IEEE 754 bytes (no string parsing)
  • generated proto stubs committed with post-processed import fix for package compatibility
  • pyproject.toml with grpcio/protobuf deps and pytest dev dependency

what was tested

  • 7 unit tests covering client construction, context manager, auth metadata, and
    metric enum mapping — all passing
  • verified proto import fix works correctly (generated code references ember.proto.ember.v1
    instead of bare ember.v1 which conflicts with the package name)
  • makefile proto-gen target regenerates stubs and applies the import fix automatically

design considerations

  • the generated grpc stubs produce from ember.v1 import ember_pb2 which conflicts
    with the ember package namespace. the makefile post-processes this to
    from ember.proto.ember.v1 import ember_pb2 via sed after codegen. this is a
    common pattern for python grpc projects with package name collisions.
  • no numpy dependency — vectors are plain list[float]. users can pass numpy arrays
    since protobuf accepts any iterable of floats.
  • tests use unittest.mock to verify client behavior without requiring a running server.

@kacy kacy force-pushed the feat/grpc-go-client branch from 03449f1 to 8876c4a Compare February 14, 2026 16:15
Base automatically changed from feat/grpc-go-client to main February 14, 2026 16:15
@kacy kacy force-pushed the feat/grpc-py-client branch from a5dd79c to b912d9e Compare February 14, 2026 16:16
@kacy kacy merged commit fa372df into main Feb 14, 2026
7 checks passed
@kacy kacy deleted the feat/grpc-py-client branch February 14, 2026 16:16
kacy added a commit that referenced this pull request Feb 19, 2026
* add python proto codegen stubs for grpc client

* add python cache patterns to gitignore

* add python grpc client with full command coverage

* add python client tests, packaging, and makefile targets
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