Package: grpc-requests
grpc_requestsGRPC for HumansLeveragereflectionto interact with GRPC in a familiar manner for users of therequestslibrary.fromgrpc_requestsimportClientclient=Client.get_by_endpoint("localhost:50051")assertclient.service_names==["helloworld.Greeter"]request_data={"name":"sinsky"}say_hello_response=client.request("helloworld.Greeter","SayHello",request_data)assertsay_hello_response=={"message":"Hello sinsky!"}FeaturesCreate a client easily when connecting to servers implementing grpc reflectionStill support creating a client from stubs when reflection isn't availableAll unary and stream methods supportedTLS and compression connections supportedAsyncIO API supportedInstallpipinstallgrpc_requestsUsageIn short:Instantiate a client using the URL of a GRPC server and any authentication
credentials you may need. If the server utilizes SSL (and it probably does)
make sure to toggle that flag.fromgrpc_requestsimportClientmetadata=[("authorization","bearer my.cool.jwt")]client=Client.get_by_endpoint("cool.servers.arecool:443",ssl=True,metadata=metadata)Theexamples pageprovides more thorough examples of
usage scenarioes, and theunit testsare also a useful reference point.ContributingContributions from the community are welcomed and greatly appreciated.Before opening a PR,tests.shcan be used to ensure the contribution passes
linting and unit test checks.PRs should be targeted to merge with thedevelopbranch. When opening a PR,
please assign it to a maintainer for review. The maintainers will take it from
there.Questions, Comments, Issues?For questions, please start a conversation on thediscussions page!For feature requests or bugs, please open anissueand assign it the appropriate tag.Maintainerssinsky -wesky93Wayne Manselle -ViridianForgeChangeLogAll notable changes to this project will be documented in this file.The format is based onKeep a Changelog,
and this project adheres toSemantic Versioning.0.1.15- 2024-02-17AddedAdd methods to return FileDescriptors and their transistive dependencies as requested by either a name or symbolAdd option to skip automatic checking of method availabilityDeprecatedDue to the possibility of transient dependencies being missed, or other name or symbol collisions, methods to access singular FileDescriptors are deprecated and will be removed in version 0.1.17The method to retrieve fields of a method's descriptor input type alone will be removed in version 0.1.170.1.14- 2024-01-06AddedMethodMetaData accessible to clientsMethodDescriptors accessible via MethodMetaDataWhen using ReflectionClients, FileDescriptors accessible by name and symbolNew examples documented0.1.13- 2023-12-03AddedAdded channel interceptors for standard and async clientsFixedRefactored how methods and services are added to description pool to better avoid cases where FileDescriptors may be added twice.0.1.12- 2023-11-26AddedMethod to print out a generic descriptor added to utils collectionHelper methods to print out a method's request and responses in a human readable formatChangedDocumentation revampedVersion checks to avoid using deprecated methods added to async clientFixedIncluderequirements.txtin build manifestDeprecatedMethod to retrieve fields for the descriptor of a method's input type.Added0.1.11- 2023-10-05AddedMethod to retrieve fields for the descriptor of a method's input type.ChangesUpdates to minimum versons of requirements to address vulnerabilities0.1.10- 2023-03-07FixedCorrected pin ofprotobufversion inrequirements.txt0.1.9- 2023-02-14ChangesReimplementation of test case frameworkRestoration of reflection client test casesUpdates to continuous integration pipeline0.1.8- 2023-01-24ChangesUpdate project and dev dependencies to versions that require Python >= 3.7Update project documentation and examples0.1.7- 2022-12-16Deprecatedhomi dependency, as the project has been archivedhomi dependent test code0.1.6- 2022-11-10FixedIgnore repeat imports of protobufs and reflecting against a server0.1.3- 2022-7-14Fixedremove clickIssuesignore test before deploy0.1.2- 2022-7-70.1.1- 2022-6-13Changesremove unused package : click #350.1.0- 2021-8-21AddedFull TLS connection supportFixedIgnore reflection if service already registeredChangedUpdate grpcio version0.0.10- 2021-2-27FixedFix 3.6 compatibility issue : await is in f-string0.0.9- 2020-12-25AddedSupport AsyncIO API0.0.8- 2020-11-24AddedAdd StubClientFixedBypasss kwargs to base client0.0.7- 2020-10-4AddedSupport Compression0.0.6- 2020-10-3AddedSupport TLS connections0.0.5- 2020-9-9ChangedResponse filled gets original proto field name rather than(before returned lowerCamelCase)0.0.4- 2020-7-210.0.3- 2020-7-21AddedDynamic request methodService client0.0.2- 2020-7-20AddedSupport all method typesAdd request test case0.0.1- 2020-7-20AddedSync proto using reflectionAuto convert request(response) from(to) dictSupport unary-unary