ads package

Subpackages

Submodules

ads.cli module

ads.config module

ads.config.export(uri: str | None = '~/.ads/config', auth: Dict | None = None, force_overwrite: bool | None = False) Config[source]

Exports the ADS config.

Parameters:
  • uri ((str, optional). Defaults to ~/.ads/config.) – The path to the config file. Can be local or Object Storage file.

  • auth ((Dict, optional). Defaults to None.) – The default authentication is set using ads.set_auth API. If you need to override the default, use the ads.common.auth.api_keys or ads.common.auth.resource_principal to create appropriate authentication signer and kwargs required to instantiate IdentityClient object.

  • force_overwrite ((bool, optional). Defaults to False.) – Overwrites the config if exists.

Returns:

The ADS config object.

Return type:

ads.Config

ads.config.load(uri: str | None = '~/.ads/config', auth: Dict | None = None, force_overwrite: bool | None = False) Config[source]

Imports the ADS config.

The config will be imported from the URI and saved the ~/.ads/config.

Parameters:
  • uri ((str, optional). Defaults to ~/.ads/config.) – The path where the config file needs to be saved. Can be local or Object Storage file.

  • auth ((Dict, optional). Defaults to None.) – The default authentication is set using ads.set_auth API. If you need to override the default, use the ads.common.auth.api_keys or ads.common.auth.resource_principal to create appropriate authentication signer and kwargs required to instantiate IdentityClient object.

  • force_overwrite ((bool, optional). Defaults to False.) – Overwrites the config if exists.

Returns:

The ADS config object.

Return type:

ads.Config

ads.config.open(uri: str | None = '~/.ads/config', profile: str | None = 'DEFAULT', mode: str | None = 'r', auth: Dict = None)[source]

Context manager helping to read and write config files.

Parameters:
  • uri ((str, optional). Defaults to ~/.ads/config.) – The path to the config file. Can be local or Object Storage file.

  • profile ((str, optional). Defaults to DEFAULT) – The name of the profile to be loaded.

  • mode ((str, optional). Defaults to r.) – The config mode. Supported values: [‘r’, ‘w’]

  • auth ((Dict, optional). Defaults to None.) – The default authentication is set using ads.set_auth API. If you need to override the default, use the ads.common.auth.api_keys or ads.common.auth.resource_principal to create appropriate authentication signer and kwargs required to instantiate IdentityClient object.

Yields:

ConfigSection – The config section object.

Module contents

ads.getLogger(name='ads')[source]
ads.hello()[source]
ads.set_debug_mode(mode=True)[source]

Enable/disable printing stack traces on notebook.

Parameters:

mode (bool (default True)) – Enable/disable print stack traces on notebook

ads.set_documentation_mode(mode=False)[source]

This method is deprecated and will be removed in future releases. Enable/disable printing user tips on notebook.

Parameters:

mode (bool (default False)) – Enable/disable print user tips on notebook

ads.set_expert_mode()[source]

This method is deprecated and will be removed in future releases. Enables the debug and documentation mode for expert users all in one method.