Quick test,homepage
Doing it in virtual environment,it's now build into Python newer versions as you use 3.7.
As i using ptpython all methods is showing up automatically after grpc
There is a lot method if list all without special methods(__something__).
With a hello world example after clone from Repo.
So can do a test of that:
Doing it in virtual environment,it's now build into Python newer versions as you use 3.7.
E:\div_code λ python -m venv grpv_env E:\div_code λ cd grpv_env\ E:\div_code\grpv_env λ E:\div_code\grpv_env\Scripts\activate # Install into environment (grpv_env) E:\div_code\grpv_env λ pip install grpcio Collecting grpcio Downloading ..... Installing collected packages: six, grpcio Successfully installed grpcio-1.20.1 six-1.12.0 (grpv_env) E:\div_code\grpv_env λ pip install ptpython Collecting ptpython .... Installing collected packages: parso, jedi, docopt, pygments, wcwidth, prompt-toolkit, ptpython Successfully installed docopt-0.6.2 jedi-0.13.3 parso-0.4.0 prompt-toolkit-2.0.9 ptpython-2.0.4 pygments-2.4.0 wcwidth-0.1.7I also install ptpython into environment,this make a lot easier to explore a package that not has so much Python documentation.
(grpv_env) E:\div_code\grpv_env λ ptpython >>> import grpc >>> grpc.__version__ '1.20.1'So there is a lot of method under
grpc
eg grpc.Call
ect...As i using ptpython all methods is showing up automatically after grpc
.
,with doc string.There is a lot method if list all without special methods(__something__).
Output:>>> [i for i in dir(grpc) if not i.startswith('__')]
['AuthMetadataContext', 'AuthMetadataPlugin', 'AuthMetadataPluginCallback', 'Call', 'CallCredentials', 'Channel', 'ChannelConnectivity', 'ChannelCredentials', 'ClientCallDetails', 'Future', 'FutureCancelledError', 'FutureTimeoutError', 'GenericRpcHandler', 'HandlerCallDetails', 'RpcContext', 'RpcError', 'RpcMethodHandler', 'Server', 'ServerCertificateConfiguration', 'ServerCredentials', 'ServerInterceptor', 'ServiceRpcHandler', 'ServicerContext', 'Status', 'StatusCode', 'StreamStreamClientInterceptor', 'StreamStreamMultiCallable', 'StreamUnaryClientInterceptor', 'StreamUnaryMultiCallable', 'UnaryStreamClientInterceptor', 'UnaryStreamMultiCallable', 'UnaryUnaryClientInterceptor', 'UnaryUnaryMultiCallable', '_create_servicer_context', '_cygrpc', '_cython', '_grpcio_metadata', 'abc', 'access_token_call_credentials', 'channel_ready_future', 'composite_call_credentials', 'composite_channel_credentials', 'contextlib', 'dynamic_ssl_server_credentials', 'enum', 'insecure_channel', 'intercept_channel', 'logging', 'metadata_call_credentials', 'method_handlers_generic_handler', 'secure_channel', 'server', 'six', 'ssl_channel_credentials', 'ssl_server_certificate_configuration', 'ssl_server_credentials', 'stream_stream_rpc_method_handler', 'stream_unary_rpc_method_handler', 'sys', 'unary_stream_rpc_method_handler', 'unary_unary_rpc_method_handler']
Version pip show:(grpv_env) E:\div_code\grpv_env λ pip show grpcio Name: grpcio Version: 1.20.1 Summary: HTTP/2-based RPC framework Home-page: https://grpc.io Author: The gRPC Authors Author-email: [email protected] License: Apache License 2.0 Location: e:\div_code\grpv_env\lib\site-packages Requires: six Required-by:Looking at doc there is also
pip install grpcio-tools
With a hello world example after clone from Repo.
So can do a test of that:
(grpv_env) E:\div_code\grpv_env λ pip install grpcio-tools Collecting grpcio-tools Downloading ..... Installing collected packages: protobuf, grpcio-tools Successfully installed grpcio-tools-1.20.1 protobuf-3.7.1 (grpv_env) E:\div_code\grpv_env λ git clone -b v1.20.0 https://github.com/grpc/grpc Cloning into 'grpc'... Checking out files: 100% (10008/10008), done.Test server --> client.
(grpv_env) E:\div_code\grpv_env\grpc\examples\python\helloworld ((no branch)) λ python greeter_server.pyNow in a other cmder window.
(grpv_env) E:\div_code\grpv_env\grpc\examples\python\helloworld ((no branch)) λ python greeter_client.py Greeter client received: Hello, you!