Skip to content

Index

Module to interact with EMS services.

This module serves as entry point to all high-level functionality within the EMS.

get_celonis

get_celonis(
    base_url=None,
    api_token=None,
    key_type=None,
    user_agent=None,
    proxies=None,
    connect=True,
    permissions=True,
    check_if_outdated=True,
    retries=0,
    delay=1,
    verify_ssl=False,
    **kwargs
)

Get a Celonis object.

Parameters:

  • base_url (Optional[str], default: None ) –

    Celonis base URL.

  • api_token (Optional[APITokenType], default: None ) –

    Celonis API token.

  • key_type (Optional[Union[str, KeyType]], default: None ) –

    KeyType of API token. One of [APP_KEY, USER_KEY] or pycelonis_core.client.KeyType.

  • user_agent (Optional[str], default: None ) –

    Session header value for User-Agent.

  • proxies (Optional[ProxiesTypes], default: None ) –

    Web proxy server URLs passed on to the httpx client HTTPX Proxying

  • connect (bool, default: True ) –

    If True connects to Celonis on initialization (initial request to check if the token & key_type combination is correct).

  • permissions (bool, default: True ) –

    If True provides permission information.

  • check_if_outdated (bool, default: True ) –

    If true checks if current pycelonis version is outdated.

  • retries (int, default: 0 ) –

    Number of total retries if request is failing.

  • delay (int, default: 1 ) –

    Delay between retries in seconds.

  • verify_ssl (Union[str, bool, SSLContext], default: False ) –

    Requiring requests to verify the TLS certificate at the remote end. For more details see HTTPX SSL Certificates.

Returns:

Examples:

Connecting to EMS using CELONIS_API_TOKEN and CELONIS_URL environmental variables:

celonis = get_celonis()

Connecting with a different set of credentials:

celonis = get_celonis(
    base_url="<url>", api_token="<api_token>", key_type="<key_type>"
)

Connecting with a dynamic set of credentials:

def get_api_token():
    # Obtain credentials dynamically (e.g. during an OAuth 2.0 flow).
    pass

celonis = get_celonis(
    base_url="<url>", api_token=get_api_token, key_type="<key_type>"
)

Initialising object without testing connection and reading permissions:

celonis = get_celonis(connect=False, permissions=False)

Connecting with httpx web proxies:

from urllib.request import getproxies()
celonis = get_celonis(proxies=getproxies())