Skip to main content

Adobe Experience Cloud APIs Implementation for Python

Project description

Adobe Experience Cloud APIs for Python

Build Status PyPI version

This Project tries to implement all Adobe Experience Cloud APIs for Python under one umbrella. Create an integration, select an authentication method and call your desired API.

Note: In this stage not all APIs and authentication methods are implemented

How to install

Either clone this repository and run the setup script or install it via pip:

pip install experiencecloudapis

Authentication Methods

Currently only the Service Account (JWT) client is implemented.

Service Account (JWT)

In order to get authenticated, you need to create an integration with Adobe I/O first. You can read how to create a integration here. When creating the JWT client, you need to specify the path to your service account json file, private key file and company id. The service account json file nowadays can be easily retrieved from your Adobe I/O console. In order to do so, navigate to your intergration and click on the top right Download JSON button. The authentication client is configured to read and understand this file out of the box. When creating your integration, you have to upload a private/public key pair to your integration in order to make it work. This can be done either via the command line or via the Generate a public/private key pair method in your Adobe I/O integration. After your key pair is generated, save the private key safely on your computer and use it for the authentication. Retrieving the company id is rather a hard nut. In order to achieve it, we logged in into the Adobe Analytics API Swagger UI and executed an API method, then retrieved the company id from the request URL, which looks something like this: https://analytics.adobe.io/api/{COMPANY_ID}/calculatedmetrics

# JWT authentication example
from experiencecloudapis.authentication import JWT

path_to_service_account_json = "/path/to/file.json"
path_to_private_key = "/path/to/private.key"
company_id = "company_id"

# if everything works well, you have created your jwt client and can inject it into your API client
jwt_client = JWT(path_to_service_account_json, path_to_private_key, company_id)

Supported APIs

Currently implemented APIs:

  • Analytics (All Analytics 2.0 APIs are implemented and missing ones from 1.4 as Classifications)

Request Analytics API

Requesting an API is easy after you managed to create the integration. Plug the authentication client into any of the APIs you want to request and call the respective method.

# setup the Analytics API Client and request the metrics method
from experiencecloudapis import Analytics

# report suite id is required for getting metrics
rsid = "rsid"

# inject the authentication client into your API
analytics_client = Analytics(jwt_client)
response = analytics_client.get_metrics(rsid)

Adobe Analytics Report Class

Requesting Adobe Analytics Reports is a common task and in order to ease the way to retrieve and process the response, we have created a helper class. In order to work easily with the Adobe Analytics Reports API, a helper Class requests and processes responses automatically. Adobe Reports API responses come in a rather generic format, which needs to be processed in order to be useful for further analysis. This class processes the response and resolves the data into an intermediate table which can be transformed further into famous formats as pandas.DataFrame, json or csv. Currently this helper class works only with the Analytics Debugger JSON object, which can be extracted in Analytics Workspace via the Debugger option. Copy and Paste the request payload into your script and execute the request. See the example below:

from experiencecloudapis import AnalyticsReport

payload = {...} # Copy from Analytics Debugger

report_client = AnalyticsReport(jwt_client)
report_client.request_report(payload)
# now you have many options how to represent the response
report_client.to_dataframe() # pandas.DataFrame
report_client.to_csv() # csv string
report_client.to_json() # json string
report_client.to_dict() # dict

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

experiencecloudapis-1.2.0.tar.gz (28.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

experiencecloudapis-1.2.0-py3-none-any.whl (32.0 kB view details)

Uploaded Python 3

File details

Details for the file experiencecloudapis-1.2.0.tar.gz.

File metadata

  • Download URL: experiencecloudapis-1.2.0.tar.gz
  • Upload date:
  • Size: 28.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.6

File hashes

Hashes for experiencecloudapis-1.2.0.tar.gz
Algorithm Hash digest
SHA256 87c22fb59aec768fb567385e518d97529a07d3716602e3bf21c4c29ad4830f6c
MD5 2e5c3853e71fa7d07eb059ef621aae00
BLAKE2b-256 a5ddc0782751064327deeb7a7d21207faa90e409b996b95125135e3456969ea2

See more details on using hashes here.

File details

Details for the file experiencecloudapis-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: experiencecloudapis-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 32.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.6

File hashes

Hashes for experiencecloudapis-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ec0e25e7791e26a8490e2f75eadba8cfc5757357c61dedf8d6dbef22d9a46e4c
MD5 d1b7ada68a4d6904295893d0a3d210e2
BLAKE2b-256 fa87cfd59af033c40256207b77d3480ebacacfae9eff3c2502837c42feec5956

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page