{"id":15978000,"url":"https://github.com/yu-iskw/python-grpc-example","last_synced_at":"2025-03-26T22:31:05.991Z","repository":{"id":145587303,"uuid":"113802232","full_name":"yu-iskw/python-grpc-example","owner":"yu-iskw","description":"Example to use gRPC in python with docker","archived":false,"fork":false,"pushed_at":"2017-12-11T05:50:59.000Z","size":4,"stargazers_count":3,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-22T15:04:07.143Z","etag":null,"topics":["docker","grpc","microservice","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yu-iskw.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-12-11T02:21:53.000Z","updated_at":"2024-07-15T12:34:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"7da81be0-4da4-4359-822b-3d2b4d0d573c","html_url":"https://github.com/yu-iskw/python-grpc-example","commit_stats":{"total_commits":1,"total_committers":1,"mean_commits":1.0,"dds":0.0,"last_synced_commit":"951a096db529d2de5bd09a09eeb483db27eb3108"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yu-iskw%2Fpython-grpc-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yu-iskw%2Fpython-grpc-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yu-iskw%2Fpython-grpc-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yu-iskw%2Fpython-grpc-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yu-iskw","download_url":"https://codeload.github.com/yu-iskw/python-grpc-example/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245747561,"owners_count":20665807,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","grpc","microservice","python"],"created_at":"2024-10-07T23:04:23.892Z","updated_at":"2025-03-26T22:31:05.951Z","avatar_url":"https://github.com/yu-iskw.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gRPC example in python\n\nThis is an example to run gRPC server on docker as well as access the server from a client on a local machine.\nThose files in the repository derives from an official example.\n\n- [grpc/examples/python/helloworld at master · grpc/grpc](https://github.com/grpc/grpc/tree/master/examples/python/helloworld)\n\n## Requirements\n\n- Docker\n- Anaconda\n- Make\n\n## Implement the files\n\n1. Define the protocol-buffer in `helloworld.proto`.\n2. Implement a command to generate python files from `helloworld.proto` in `codegen.py`.\n3. Implement `grpc_server.py`.\n4. Implement `greeter_server.py`.\n\n## How to set up an environment on our local machine\nThe command creates an anaconda environment.\nWe can activate the environment with `source activate grpc-example`, since the environment name is `grpc-example`.\n```\nmake create-conda\n\n# If you would like to remove the anaconda envronment,\nmake delete-conda\n```\n\n## How to run the server and the client on our local machine\n```\npython grpc_server.py\n\npython greeter_client.py\nGreeter client received: Hello, cool guy!\n```\n\n## How to build and run a docker image\nThe docker image is used for running `grpc_server.py`.\nThe host name depends on your environment.\nIf you use `docker-machine`, we can see the IP address with `docker-machine ip YOUR_DOCKER_MACHINE`.\n```\nmake build-docker\n\nmake run-docker\n```\n\nAnd then, we check if the client can access the server on docker or not:\n\n```\n# Execute it on your local machine, not a docker container.\npython greeter_cliept.py --host HOST_NAME --port 50051\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyu-iskw%2Fpython-grpc-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyu-iskw%2Fpython-grpc-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyu-iskw%2Fpython-grpc-example/lists"}