Skip to content

orca_sdk.orca_credentials#

ApiKeyInfo #

Bases: NamedTuple

Named tuple containing information about an API key

Attributes:

  • name (str) –

    Unique name of the API key

  • created_at (datetime) –

    When the API key was created

OrcaCredentials #

Class for managing Orca API credentials

get_api_url staticmethod #

get_api_url()

Get the Orca API base URL that is currently being used

list_api_keys staticmethod #

list_api_keys()

List all API keys that have been created for your org

Returns:

  • list[ApiKeyInfo]

    A list of named tuples, with the name and creation date time of the API key

is_authenticated staticmethod #

is_authenticated()

Check if you are authenticated to interact with the Orca API

Returns:

  • bool

    True if you are authenticated, False otherwise

set_api_key staticmethod #

set_api_key(api_key, check_validity=True)

Set the API key to use for authenticating with the Orca API

Note

The API key can also be provided by setting the ORCA_API_KEY environment variable

Parameters:

  • api_key (str) –

    The API key to set

  • check_validity (bool, default: True ) –

    Whether to check if the API key is valid and raise an error otherwise

Raises:

  • ValueError

    if the API key is invalid and check_validity is True