Metadata-Version: 2.1
Name: dynagrpc
Version: 0.1.0
Summary: DynagRPC Python abstraction library over gRPC and protobuf types.
Requires-Python: >=3.7
Description-Content-Type: text/markdown
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Requires-Dist: grpcio-tools
Requires-Dist: protobuf
Requires-Dist: typing_extensions;python_version=='3.7'
Project-URL: Home, https://github.com/danilobellini/dynagrpc

# DynagRPC

DynagRPC is a Python library to help writing/using gRPC and protobuf.

# Simple server implementation

Say we have this protobuf definition for a simple addition RPC:

```protobuf
syntax = "proto3";
package tests.maths;

service Maths {
  rpc Add (AddRequest) returns (AddResponse) {}
}

message AddRequest {
  int32 first = 1;
  int32 second = 2;
}

message AddResponse {
  int32 result = 1;
}
```

Keeping just the proto (i.e., not compiled with `protoc`), we can use
it with the following implementation in Python is:

```python
from dynagrpc import GrpcServer

server = GrpcServer("tests", "Maths", "maths")

@server.rpc()
def add(first, second):
    return first + second
```

Which you can run, for example, with:

```python
server.run(host="localhost", port="50051")
```

