Nominal API Protos

raw JSON →
0.1234.0 verified Sat May 09 auth: no python

Python protobuf/gRPC stubs for the Nominal API. Version 0.1234.0. Released on demand.

pip install nominal-api-protos
error ModuleNotFoundError: No module named 'nominal_pb2'
cause Trying to import nominal_pb2 directly instead of from nominal_api
fix
Use from nominal_api import nominal_pb2
error AttributeError: module 'nominal_api' has no attribute 'NominalStub'
cause Stub classes are in the grpc submodule, not the top-level package
fix
Import from nominal_api import nominal_pb2_grpc; then use nominal_pb2_grpc.NominalStub
deprecated Package versioning may not follow strict semver; minor version bumps may introduce breaking changes in proto stubs.
fix Pin exact version in requirements.txt, e.g. nominal-api-protos==0.1234.0
gotcha Importing from nominal_api directly won't work; always use submodules like nominal_pb2 and nominal_pb2_grpc.
fix Use from nominal_api import nominal_pb2
gotcha Generated protobuf classes may change field names or types between releases; check release notes before upgrading.
fix Review nominal-api-protos changelog before bumping version

Create a gRPC channel and call Ping.

import os
import grpc
from nominal_api import nominal_pb2 as pb
from nominal_api import nominal_pb2_grpc as grpc_stubs

channel = grpc.insecure_channel(os.environ.get('NOMINAL_API_ENDPOINT', 'localhost:50051'))
stub = grpc_stubs.NominalStub(channel)
response = stub.Ping(pb.PingRequest())
print(response)