Skip to main content

Data Engineering tool for accessing Adobe CJA Reporting API

Project description

py2adobe_reporting

A Python wrapper for Adobe Customer Journey Analytics (CJA) Reporting API that enables analysts to easily extract and analyze data programmatically.

New in v0.0.20

JSON Extractor Tool

A visual web-based tool that extracts table and visualization metadata from Adobe CJA Analysis Workspace projects and automatically generates API request bodies.

  • Import Workspace Projects – Fetch any project by ID and extract all metadata
  • 10+ Visualization Types – Generates request bodies for Freeform Tables, Area Charts, Bar Charts, Key Metric Summary, and more
  • Smart Source Resolution – Visualizations automatically inherit data from linked source tables
  • Component Mining – Recursively extracts all segments, metrics, dimensions, and date ranges
  • Modern UI – Dark theme with color-coded badges and collapsible sections
from py2adobe_reporting.cja_functions.reporting_management import Reporting

reporting = Reporting()
url = reporting.json_extractor_launch(headers)
# Browser opens to the JSON Extractor UI

# When done:
reporting.json_extractor_stop()

See JSON Extractor Documentation for full details.

Features

  • Time Series Reports - Daily and monthly aggregated metrics
  • Multi-Metric Analysis - Pull up to 5 metrics in a single report
  • Dimension Breakdowns - Break down metrics by multiple dimensions
  • Top Items Analysis - Get top 10 dimension items with optional search
  • Pagination Support - Handle large datasets with automatic pagination (up to 50,000 rows per page)
  • Server-to-Server Authentication - Secure OAuth 2.0 authentication

Installation

pip install py2adobe_reporting

Or install from source:

git clone https://github.com/jaytmii/py2adobe_reporting_package.git
cd py2adobe_reporting_package
pip install -e .

Requirements

  • Python >= 3.8
  • Adobe CJA API credentials (OAuth 2.0 Server-to-Server)

Quick Start

1. Set Up Authentication

Create a JSON configuration file with your Adobe credentials:

{
  "client_secret": "your-client-secret",
  "company_id": "your-company-id",
  "ims_host": "ims",
  "token_url": "token_url",
  "default_headers": {
    "x-api-key": "your-api-key",
    "x-gw-ims-org-id": "your-org-id"
  },
  "scopes": "api_scopes",
}

2. Authenticate

from py2adobe_reporting.auth import s2s_auth

# Authenticate and get environment object
env = s2s_auth("path/to/config.json")

3. Generate Headers

from py2adobe_reporting.auth import cja_oauth_headers

# Create headers for API calls
headers = cja_oauth_headers("path/to/config.json", env.token)

4. Pull a Report

from py2adobe_reporting.cja_functions.reporting_management import Reporting

# Initialize reporting class
reporting = Reporting()

# Get daily time series report
df = reporting.daily_time_series_report(
    headers=headers,
    data_view_id="your-data-view-id",
    start_date="2024-01-01",
    end_date="2024-01-31",
    metric="metrics/visits"
)

print(df.head())

Available Functions

Time Series Reports

  • monthly_time_series_report() - Month-level aggregated metrics
  • daily_time_series_report() - Day-level aggregated metrics

Multi-Dimensional Reports

  • five_metrics_report() - Pull 5 metrics with a dimension
  • breakdown_report() - Break down a metric by two dimensions
  • get_all_rows_report() - Get all rows for custom request body

Utility Functions

  • get_single_call_report() - Single API call with custom body
  • get_total_table_rows() - Get row count for a table
  • get_total_table_pages() - Calculate total pages needed
  • get_top_ten_dimension_items() - Get top 10 items for a dimension

Documentation

For detailed function parameters and examples, see:

Example Use Cases

Get Daily Visits

df = reporting.daily_time_series_report(
    headers=headers,
    data_view_id="your-data-view-id",
    start_date="2024-01-01",
    end_date="2024-01-31",
    metric="metrics/visits"
)

Get Monthly Visits

df = reporting.monthly_time_series_report(
    headers=headers,
    data_view_id="dv_123",
    start_date="2024-01-01",
    end_date="2024-12-31",
    metric="metrics/visits"
)

Breakdown by Multiple Dimensions

df = reporting.breakdown_report(
    headers=headers,
    data_view_id="dv_123",
    start_date="2024-01-01",
    end_date="2024-01-31",
    dimension="variables/page",
    metric="metrics/visits",
    dim_rows_per_page=50,
    breakdown_dim="variables/browser",
    breakdown_rows_per_page=50
)

Search for Dimension Items

df = reporting.get_top_ten_dimension_items(
    headers=headers,
    data_view_id="dv_123",
    start_date="2024-01-01",
    end_date="2024-01-31",
    dimension="variables/page",
    search_type="contains",
    contains_term="( CONTAINS 'product' )"
)

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Author

James Mitchell - jaytmii@gmail.com

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

py2adobe_reporting-0.0.20.tar.gz (37.5 kB view details)

Uploaded Source

Built Distribution

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

py2adobe_reporting-0.0.20-py3-none-any.whl (29.6 kB view details)

Uploaded Python 3

File details

Details for the file py2adobe_reporting-0.0.20.tar.gz.

File metadata

  • Download URL: py2adobe_reporting-0.0.20.tar.gz
  • Upload date:
  • Size: 37.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for py2adobe_reporting-0.0.20.tar.gz
Algorithm Hash digest
SHA256 7a578a245b3fd312165a4b71dbd61827fff72abd207463a68853cde4b2ad173c
MD5 4b02063f47b6ba598c68bcb3151b037a
BLAKE2b-256 1c38be1f3d33fe03412aeb3d6178902688ef627eb9a136dd48540da5e705873e

See more details on using hashes here.

File details

Details for the file py2adobe_reporting-0.0.20-py3-none-any.whl.

File metadata

File hashes

Hashes for py2adobe_reporting-0.0.20-py3-none-any.whl
Algorithm Hash digest
SHA256 b262789d13f088a00c48317f7f2521f0da3907c959614be7776badfdbff29b04
MD5 9542d5b7eb761c120cda40e9560e7606
BLAKE2b-256 498708820d55bcc253dac2e762c3667b37619101394e95ad8358d496a55b55fc

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