DynagRPC Python abstraction library over gRPC and protobuf types.
Project description
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:
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:
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:
server.run(host="localhost", port="50051")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dynagrpc-0.1.0.tar.gz.
File metadata
- Download URL: dynagrpc-0.1.0.tar.gz
- Upload date:
- Size: 16.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.32.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5d82f6d194c22f3adcc197dca0ef81b64868d9f22053f0f499b2725db3be209e
|
|
| MD5 |
55da436b7cf11a40e5c6e7363c5348ef
|
|
| BLAKE2b-256 |
fbca283029c627222d691986adabb80d0d1c102de24b1cc235efb2f277c6cbec
|
File details
Details for the file dynagrpc-0.1.0-py3-none-any.whl.
File metadata
- Download URL: dynagrpc-0.1.0-py3-none-any.whl
- Upload date:
- Size: 15.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.32.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
22572f6193f805506e2c88d7f14dd8d578019a08935713ccd8953f39b62adb9a
|
|
| MD5 |
cffbeeda095ef4908b0affd77bf4b63c
|
|
| BLAKE2b-256 |
f766b60e606dbb4eb112a9dd5b77c8473ce1317a54fccd5733c0d44457e91d4e
|