Metadata-Version: 2.5
Name: vention-grpc-py-sdk
Version: 0.0.69
Summary: Generated Python gRPC clients for vention-protos
Project-URL: Homepage, https://github.com/VentionCo/vention-protos-clients
Project-URL: Repository, https://github.com/VentionCo/vention-protos-clients
Author: VentionCo
License: Proprietary
Keywords: client,grpc,protobuf,vention
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.10
Requires-Dist: grpcio<2,>=1.74.0
Requires-Dist: protobuf<7,>=6.31.1
Description-Content-Type: text/markdown

# vention-grpc-py-sdk

Generated Python gRPC clients for [vention-protos](https://github.com/VentionCo/vention-protos).

## Install

```bash
pip install vention-grpc-py-sdk
```

## Usage

```python
import grpc
from vention.robots.v1 import robot_service_pb2_grpc
from vention import PROTOS_SHA

channel = grpc.insecure_channel("localhost:50550")
stub = robot_service_pb2_grpc.RobotServiceStub(channel)
print(f"built from vention-protos@{PROTOS_SHA}")
```

`PROTOS_SHA` is the `vention-protos` commit this wheel was generated from.

## Vision service backends

The `vention/vision/v1` services also ship generated backend interfaces, so calling
code can be written against an ABC and swapped between gRPC and a local
implementation.

```python
from vention.vision.v1 import image_pb2
from vention.vision.v1.vision_service_abc import (
    ImageServiceBackend,
    create_image_service_backend,
    register_image_service_backend,
)

backend = create_image_service_backend("grpc", target="localhost:41051")
response = backend.capture_image(image_pb2.CaptureImageRequest())


class InProcessImageService(ImageServiceBackend):
    def capture_image(self, request): ...
    def upload_image(self, requests): ...
    def download_image(self, request): ...


register_image_service_backend("in_process", InProcessImageService)
backend = create_image_service_backend("in_process")
```

There is one `<Service>Backend` ABC, one `<Service>GrpcBackend`, and one
`register_`/`create_` pair per service in `vision_service.proto`.
