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:
Name | Type | Required | Default | Description |
---|---|---|---|---|
client | str | Yes | None | Adobe Target client ID |
organization_id | str | Yes | None | Experience Cloud Organization ID |
timeout | int | No | 3000 | Timeout in milliseconds |
server_domain | str | No | client.tt.omtrdc.net | |
secure | bool | No | true | Unset to enforce HTTP scheme |
logger | object | No | INFO logger | |
target_location_hint | str | No | None | Target location hint |
property_token | str | No | None | Target Property Token. If specified here, all get_offers calls will use this value. |
decisioning_method | str | No | server-side | Determines which decisioning method to use (on-device, server-side, hybrid) |
polling_interval | int | No | 300000 (5 minutes) | Polling interval for the on-device decisioning rule artifact (in ms) |
artifact_location | str | No | None | A fully qualified url to the on-device decisioning rule artifact. Overrides internally determined location. |
artifact_payload | object | No | None | The JSON payload of the on-device decisioning rule artifact. If specified, it is used instead of requesting one from a URL. |
events | dict <str, callable> | No | None | An optional object with event name keys and callback function values |
environment_id | int | No | production | The Target environment ID |
environment | str | No | production | The Target environment name |
cdn_environment | str | No | production | The CDN environment name |
telemetry_enabled | bool | No | True | If set to False, telemetry data will not be sent to Adobe |
version | str | No | None | The 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