Skip to main content

ZhiYan Python gRPC SDK

Project description

libzygrpc

智眼Grpc SDK

生成gRPC代码

安装依赖:

pip install -U grpcio protobuf grpcio-tools

生成gRPC代码:

在libzygrpc目录下运行

python -m grpc_tools.protoc -I . --python_out=python/ --grpc_python_out=python/ proto/zhiyan_rpc.proto

gRPC工具会生成两个Python文件:

  • proto/zhiyan_rpc_pb2.py
  • proto/zhiyan_rpc_pb2_grpc.py

注意事项

生成 proto/zhiyan_rpc_pb2_grpc.py 文件后,需要确认其中导入 zhiyan_rpc_pb2.py 是否正确:

from proto import zhiyan_rpc_pb2 as proto_dot_zhiyan__rpc__pb2

安装SDK

从 pip 安装

pip install -U zygrpc

使用方法

使用

比如:

from proto import zhiyan_rpc_pb2

本地打包安装

打包

安装依赖包:

pip install -U setuptools wheel

运行:

rm -rf build/ dist/ zygrpc.egg-info/ && python setup.py bdist_wheel

dist 目录下会生成类似 zygrpc-1.0.0-py3-none-any.whl 的安装包。

本地安装

全局安装:

sudo pip install -U dist/zygrpc-0.0.1-py3-none-any.whl

用户目录安装:

pip install --user -U dist/zygrpc-0.0.1-py3-none-any.whl

卸载

pip uninstall zygrpc

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zygrpc-0.0.1.15.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

zygrpc-0.0.1.15-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file zygrpc-0.0.1.15.tar.gz.

File metadata

  • Download URL: zygrpc-0.0.1.15.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.5

File hashes

Hashes for zygrpc-0.0.1.15.tar.gz
Algorithm Hash digest
SHA256 820db197e16e7d0cebe3fe135a866de264e0ac7837f32670e382ffba7fef1fa8
MD5 b2bd7291863947f7432c1b811a0a37cb
BLAKE2b-256 39b5ba86ae801710750619d6e32b006066c8e2ab1305bdd23187ed8d9f9e765b

See more details on using hashes here.

File details

Details for the file zygrpc-0.0.1.15-py3-none-any.whl.

File metadata

  • Download URL: zygrpc-0.0.1.15-py3-none-any.whl
  • Upload date:
  • Size: 5.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.5

File hashes

Hashes for zygrpc-0.0.1.15-py3-none-any.whl
Algorithm Hash digest
SHA256 9de3caa9ddbb7362f0b3db2d29ead11e1866dcda52888caaeb069c19ea7d9383
MD5 efa1178fefb3996a9006becc08c037e3
BLAKE2b-256 f5710474234076c3eab4a5402a27fe108710caf370922ae06ec55b4e468f65a8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page