Skip to main content

Generated gRPC python files for interacting with Alvenir Services

Project description

Alvenir GRPC Contracts

This package provides methods for interacting with the alvenir gRPC api.

To see more about gRPC look here: https://grpc.io/

Package on pypi: https://pypi.org/project/alvenir-grpc-contracts/

Installation

pip install alvenir-grpc-contracts

Usage example

import grpc
from pathlib import Path
from alvenir_grpc_contracts.summary.v1 import summary_pb2_grpc
from alvenir_grpc_contracts.types.v1 import ping_pb2

# Endpoint needs to be provided by alvenir
ENDPOINT = "<grpc_endpoint>:443"
# Required if server uses tls
ROOT_CERT = Path("<path to alvenir ca.crt>").read_bytes()

# If server does not use tls, replace credentials and with statement with:
# with grpc.insecure_channel(ENDPOINT) as channel:
credentials = grpc.ssl_channel_credentials(root_certificates=ROOT_CERT)
with grpc.secure_channel(ENDPOINT, credentials=credentials) as channel:
    stub = summary_pb2_grpc.SummaryServiceStub(channel)
    response: ping_pb2.PingResponse = stub.Ping(
        ping_pb2.PingRequest(wait_time=1)
    )
    print(response.requests_received_utc, response.response_sent_utc)

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

alvenir_grpc_contracts-0.0.3.tar.gz (24.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

alvenir_grpc_contracts-0.0.3-py3-none-any.whl (27.6 kB view details)

Uploaded Python 3

File details

Details for the file alvenir_grpc_contracts-0.0.3.tar.gz.

File metadata

File hashes

Hashes for alvenir_grpc_contracts-0.0.3.tar.gz
Algorithm Hash digest
SHA256 baef7d17786ee4cc93ab26a863fc23d849f2634983968de77c451accdc7e7b44
MD5 91629cf48380712b0a0a25496a192c8f
BLAKE2b-256 c28c9388c72624cb9c62cd4253225280c1fd9f2119dbe84e1f76d73dd054f818

See more details on using hashes here.

File details

Details for the file alvenir_grpc_contracts-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for alvenir_grpc_contracts-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 46a76a11817caec3e76a73c497268ffc7b8181deed6c23e143bb786b76357bb7
MD5 d9e5977d69f257d23c39ea9e6c54c0c3
BLAKE2b-256 08ba2060402079ca77c55c39e9598e2aa8dbfa451f684b368a49855988e7198f

See more details on using hashes here.

Supported by

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