ads package

Subpackages

Submodules

ads.config module

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

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 authetication 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')
ads.hello()

Imports Pandas, sets the documentation mode, and prints a fancy “Hello”.

ads.set_auth(auth='api_key', oci_config_location='~/.oci/config', profile='DEFAULT')

Enable/disable resource principal identity or keypair identity in a notebook session.

Parameters
  • auth ({'api_key', 'resource_principal'}, default 'api_key') – Enable/disable resource principal identity or keypair identity in a notebook session

  • oci_config_location (str, default oci.config.DEFAULT_LOCATION, which is '~/.oci/config') – config file location

  • profile (str, default 'DEFAULT') – profile name for api keys config file

ads.set_debug_mode(mode=True)

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)

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()

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