DocumentationTarget Developer Guide

Initialize the Python SDK

Last update: July 17, 2023
  • Topics:
  • APIs/SDKs

CREATED FOR:

  • Developer

Description
Use the create method in order to initialize the Python SDK and instantiate the Target Client to make calls to Adobe Target for experiments and personalized experiences.

Method

create

TargetClient.create(options)

Parameters

options has the following structure:

NameTypeRequiredDefaultDescription
clientstrYesNoneAdobe Target client ID
organization_idstrYesNoneExperience Cloud Organization ID
timeoutintNo3000Timeout in milliseconds
server_domainstrNoclient.tt.omtrdc.net
secureboolNotrueUnset to enforce HTTP scheme
loggerobjectNoINFO logger
target_location_hintstrNoNoneTarget location hint
property_tokenstrNoNoneTarget Property Token. If specified here, all get_offers calls will use this value.
decisioning_methodstrNoserver-sideDetermines which decisioning method to use (on-device, server-side, hybrid)
polling_intervalintNo300000 (5 minutes)Polling interval for the on-device decisioning rule artifact (in ms)
artifact_locationstrNoNoneA fully qualified url to the on-device decisioning rule artifact. Overrides internally determined location.
artifact_payloadobjectNoNoneThe JSON payload of the on-device decisioning rule artifact. If specified, it is used instead of requesting one from a URL.
eventsdict <str, callable>NoNoneAn optional object with event name keys and callback function values
environment_idintNoproductionThe Target environment ID
environmentstrNoproductionThe Target environment name
cdn_environmentstrNoproductionThe CDN environment name
telemetry_enabledboolNoTrueIf set to False, telemetry data will not be sent to Adobe
versionstrNoNoneThe version number of this SDK

Example

Python

from target_python_sdk import TargetClient

def client_ready_callback(ready_event):
    # make calls to Adobe Target

client_options = {
    "client": "acmeclient",
    "organization_id": "1234567890@AdobeOrg",
    "events": {
        "client_ready": client_ready_callback
    }
}
target_client = TargetClient.create(client_options)
recommendation-more-help
6906415f-169c-422b-89d3-7118e147c4e3