On January 1, 2020 this library will no longer support Python 2 on the latest released version.
Previously released library versions will continue to be available. For more information please
visit Python 2 support on Google Cloud.
Client Options¶
Client options class.
Client options provide a consistent interface for user options to be defined across clients.
You can pass a client options object to a client.
from google.api_core.client_options import ClientOptions
from google.cloud.vision_v1 import ImageAnnotatorClient
def get_client_cert():
# code to load client certificate and private key.
return client_cert_bytes, client_private_key_bytes
options = ClientOptions(api_endpoint="foo.googleapis.com",
client_cert_source=get_client_cert)
client = ImageAnnotatorClient(client_options=options)
You can also pass a dictionary.
from google.cloud.vision_v1 import ImageAnnotatorClient
client = ImageAnnotatorClient(
client_options={
"api_endpoint": "foo.googleapis.com",
"client_cert_source" : get_client_cert
})