Skip to main content

h2o-cloud-discovery

licence pypi

H2O Cloud Discovery Client.

Installation

pip install h2o-cloud-discovery

Usage

Package provides two main functions. Synchronous h2o_discovery.discover() and asynchronous h2o_discovery.discover_async(). Both functions return a discovery object that can be used to obtain the information the H2O Cloud environment, its services and clients.

When used within the H2O AI Cloud environment or locally with the H2O AI Cloud CLI configured, no further configuration is needed.

Both functions accept a environment argument that can be used to specify the H2O Cloud environment for which the discovery should be performed. Alternatively, the H2O_CLOUD_ENVIRONMENT environment variables can be used.

See API documentation for more details.

import h2o_discovery

discovery = h2o_discovery.discover()

# Print the H2O Cloud environment that was discovered.
print(discovery.environment.h2o_cloud_environment)

# Connect to the my service.
my_service_client = my_service.client(address=discovery.services["my-service"].uri)

Examples

Example: Use within a notebook to connect to the H2O AI Drive

# Install required packages.

import sys
!{sys.executable} -m pip install h2o-cloud-discovery h2o-authn[discovery]
# Load discovery for the current environment.

import h2o_discovery

discovery = h2o_discovery.discover()
# Create a token provider using the credentials loaded from the environment.

import h2o_authn.discovery

token_provider = h2o_authn.discovery.create_async(discovery)
# Install the H2O AI Drive client in the version specified by the available
# service.

import sys
!{sys.executable} -m pip install '{discovery.services["drive"].python_client}'
# Connect to the H2O AI Drive and list home objects.

import h2o_drive

home = await h2o_drive.MyHome(
    token=token_provider, endpoint_url=discovery.services["drive"].uri
)
await home.list_objects()

Development

Please see RELEASE.md for the release process.

Project is managed using Hatch.

Testing

For quick development tests use:

hatch run devtest:pytest

Full test matrix can be run using:

hatch env remove test && hatch run test:pytest

Linting

hatch run lint:check

Formating and imports can be fixed using:

hatch run lint:fix

Metadata

Release files for h2o-cloud-discovery 4.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for h2o-cloud-discovery 4.0.0
File Size Uploaded Provenance Actions
h2o_cloud_discovery-4.0.0.tar.gz 20.3 kB Without provenance Details for h2o_cloud_discovery-4.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for h2o-cloud-discovery 4.0.0
File Interpreter ABI Platform Actions
h2o_cloud_discovery-4.0.0-py3-none-any.whl Python 3 none any Details for h2o_cloud_discovery-4.0.0-py3-none-any.whl

Total release size: 36.0 kB

Release files / h2o_cloud_discovery-4.0.0.tar.gz

Download URL h2o_cloud_discovery-4.0.0.tar.gz
Size 20.3 kB
Tags Source
SHA-256 checksum
How to use checksums
fd634af40406a3968d176eb83f9154ceed1fd9e305a1e6a8f4e02786909c602a
BLAKE2b-256 checksum
How to use checksums
52e7dec903160d1351acd3ffc16062494fa107781b741abf3460d7a61ae53f49
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / h2o_cloud_discovery-4.0.0-py3-none-any.whl

Download URL h2o_cloud_discovery-4.0.0-py3-none-any.whl
Size 15.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
02c98873df788e7b7192db0674540bc68fe4e3afa9431d95e69463c19ba0eb9f
BLAKE2b-256 checksum
How to use checksums
3fa79acb5be87b4f61cb355da4747ce493c519ab04f31c0ae7ab0d4c4ba184e6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Security for h2o-cloud-discovery 4.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page