Python client download and overview
This page provides an overview of the H2O eScorer Python client.
The eScorerAsyncClient
method has been deprecated in favor of the Client
class.
Download the Python client
To download the H2O eScorer Python client wheel, click the Python client tab in the H2O eScorer downloads page. You can then install the downloaded Python client wheel.
The h2o_escorer
Python package
The Python package h2o_escorer
provides the Python driver for H2O eScorer. It's a lightweight package with a single class, Client
, that provides a simple API with asynchronous functions. These can be used to authenticate and make predictions using models deployed on the H2O AI Cloud.
Authentication
Authenticating h2o_escorer
with H2O AI Cloud (HAIC) requires an HAIC platform token. You can get an HAIC platform token from the HAIC UI by clicking CLI & API Access and then clicking the generate token link in the Connect to the platform section. For more information, see Get the platform token.
import h2o_authn
import getpass
print(f"Visit https://internal.dedicated.h2o.ai/auth/get-platform-token to get your platform token")
token_provider = h2o_authn.TokenProvider(
refresh_token=getpass.getpass('Enter your platform token: '),
client_id="hac-platform-public",
token_endpoint_url="https://auth.internal.dedicated.h2o.ai/auth/realms/hac/protocol/openid-connect/token"
)
import h2o_escorer
client = h2o_escorer.Client(
escorer_url="https://rest-scorer.internal.dedicated.h2o.ai",
token_provider=token_provider
)
- Submit and view feedback for this page
- Send feedback about H2O eScorer to cloud-feedback@h2o.ai