Skip to main content

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

Metadata

Release files for zygrpc 0.0.1.15

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for zygrpc 0.0.1.15
File Size Uploaded
zygrpc-0.0.1.15.tar.gz 5.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for zygrpc 0.0.1.15
File Interpreter ABI Platform
zygrpc-0.0.1.15-py3-none-any.whl Python 3 none any Details

Total release size: 10.5 kB

Release files / zygrpc-0.0.1.15.tar.gz

Download URL zygrpc-0.0.1.15.tar.gz
Size 5.1 kB
Tags Source
SHA-256 checksum
How to use checksums
820db197e16e7d0cebe3fe135a866de264e0ac7837f32670e382ffba7fef1fa8
BLAKE2b-256 checksum
How to use checksums
39b5ba86ae801710750619d6e32b006066c8e2ab1305bdd23187ed8d9f9e765b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.5

Release files / zygrpc-0.0.1.15-py3-none-any.whl

Download URL zygrpc-0.0.1.15-py3-none-any.whl
Size 5.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9de3caa9ddbb7362f0b3db2d29ead11e1866dcda52888caaeb069c19ea7d9383
BLAKE2b-256 checksum
How to use checksums
f5710474234076c3eab4a5402a27fe108710caf370922ae06ec55b4e468f65a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.5

Release history Release notifications | RSS feed

This release

0.0.1.15 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page