https://github.com/guillaumefalourd/poc-grpc-python
POC of a gRPC project in Python 🐍
https://github.com/guillaumefalourd/poc-grpc-python
demo grpc message python
Last synced: about 2 months ago
JSON representation
POC of a gRPC project in Python 🐍
- Host: GitHub
- URL: https://github.com/guillaumefalourd/poc-grpc-python
- Owner: GuillaumeFalourd
- License: apache-2.0
- Created: 2021-03-05T20:21:59.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-08-03T14:49:22.000Z (almost 5 years ago)
- Last Synced: 2025-03-01T14:41:21.958Z (over 1 year ago)
- Topics: demo, grpc, message, python
- Language: Python
- Homepage: https://grpc.io/
- Size: 727 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gRPC (Google Remote Procedure Call) Python
[This code's has been inspired from from the grpc.io site.](https://grpc.io/docs/languages/python/quickstart)
## Run
### Message
#### Message Execution
From the `message` directory:
Run the server:
```bash
python3 message_server.py
```
From another terminal window, run the client:
```bash
python3 message_client.py
```
### Ritchie
#### Ritchie Premisse
- [Ritchie CLI](https://docs.ritchiecli.io/getting-started/install-cli) installed locally
- ritchie-formulas-demo Github repository imported:
```bash
rit add repo --provider="Github" --name="demo" --repoUrl="https://github.com/ZupIT/ritchie-formulas-demo" --priority=1
```
#### Ritchie Execution
From the `python/ritchie` directory:
Run the server:
```bash
python3 ritchie_server.py
```
From another terminal window, run the client:
```bash
python3 ritchie_client.py
```
## Demo
### Message Sample
#### Message inputs and response (client)

#### Logs from message server

### Ritchie Sample
#### Ritchie inputs and response (client)

#### Logs from ritchie server

## Update
### Message RPC code
Updating the `/protos/message.proto` file, we need to update the gRPC code used by our application to use the new service definition.
From the `message` directory, run:
```bash
python3 -m grpc_tools.protoc -I../protos --python_out=. --grpc_python_out=. ../protos/message.proto
```
### Ritchie RPC code
Updating the `/protos/ritchie.proto` file, we need to update the gRPC code used by our application to use the new service definition.
From the `ritchie` directory, run:
```bash
python3 -m grpc_tools.protoc -I../protos --python_out=. --grpc_python_out=. ../protos/ritchie.proto
```