Skip to main content

Welcome to the python-adjust

This is an unofficial Python wrapper for the Adjust.com REST API. I am in no way affiliated with Adjust.com, use at your own risk.

Regards

This project was inspired by adjusty

Documentation

Please find official documentation by: https://help.adjust.com/en/article/kpi-service

QuickStart

Your access to the KPI Service is tied to your Adjust user account. Each user account has an associated user token, to allow you to individually control access to your KPIs.

You can find your own user token in the dashboard, under Account Settings > Your Data > User Details. This is the user token we’ll be referring to for your authentication below.

pip install python-adjust

Let's retrieve list of applications accessible to you

from adjustapi.api import AdjustApi

api = AdjustApi('USER_TOKEN')

apps = api.list_apps()

print(apps[0].name, apps[0].token, apps[0].id)
# Prints something like: "MyTestApp ft5popkfebns com.mytest.app"

This is how KPI API works

kpis_api = api.kpi_service(trackers=trackers,
                           start_date=start_date,
                           end_date=end_date,
                           countries=countries,
                           app_tokens=app_tokens,
                           kpis=kpis)
print(str(kpis_api.fetch_kpi()))
# prints: KpiResult(result_parameters=ResultParameters(kpis=['revenue'], start_date=datetime.date(2020, 4, 4), end_date=datetime.date(2020, 5, 4), sandbox=False, countries=['us'], events=None, trackers=[TrackerResultParameters(token='tsrdag', name='Facebook Installs::Expired Attributions', currency=None, has_subtrackers=False)], grouping=['trackers'], period=None, attribution_type='click', utc_offset='00:00', cohort_period_filter=None, day_def=None, attribution_source='dynamic'), result_set={'token': 'thomki', 'name': 'Facebook Installs', 'currency': 'USD', 'trackers': [{'token': 'tsodkg', 'kpi_values': [3627.54]}]})

print(str(kpis_api.fetch_events()))
# prints: KpiResult(result_parameters=ResultParameters(kpis=['revenue'], start_date=datetime.date(2020, 4, 4), end_date=datetime.date(2020, 5, 4), sandbox=False, countries=['us'], events=[EventParameter(name='com.test.subscription.name', token='s6p2ub'), EventParameter(name='event_name', token='eakvze'), EventParameter(name='event.name.2', token='5a6u7u'), EventParameter(name='event_name_3', token='e34v0e')], trackers=[TrackerResultParameters(token='6tcrta', name='Facebook Installs::Expired Attributions', currency=None, has_subtrackers=False)], grouping=['trackers', 'event_types'], period=None, attribution_type='click', utc_offset='00:00', cohort_period_filter=None, day_def=None, attribution_source='dynamic'), result_set={'token': 'thamsi', 'name': 'Facebook Installs', 'currency': 'USD', 'trackers': [{'token': 'tsrdta', 'events': [{'token': 'e6e2v1', 'kpi_values': [1149.77]}, {'token': 'ea3vpe', 'kpi_values': [95.88]}, {'token': 'e34v0e', 'kpi_values': [17.99]}, {'token': 'eovy8e', 'kpi_values': [147.63]}}]}]})

print(str(kpis_api.fetch_cohorts()))
# KpiResult(result_parameters=ResultParameters(kpis=['revenue'], start_date=datetime.date(2020, 4, 4), end_date=datetime.date(2020, 5, 4), sandbox=False, countries=['us'], events=None, trackers=[TrackerResultParameters(token='csodbh', name='Facebook Installs::Expired Attributions', currency=None, has_subtrackers=False)], grouping=['trackers', 'periods'], period='day', attribution_type='click', utc_offset='00:00', cohort_period_filter=None, day_def='24h', attribution_source='dynamic'), result_set={'token': 'chamsh', 'name': 'Facebook Installs', 'currency': 'USD', 'trackers': [{'token': 'cscoth', 'periods': [{'period': '0', 'kpi_values': [109.89]}}]}]})

But most of the time you need these data as table, so you can retrieve it as pandas Dataframe

kpis_api = api.kpi_service(trackers=trackers,
                           start_date=start_date,
                           end_date=end_date,
                           countries=countries,
                           app_tokens=app_tokens,
                           kpis=kpis)
print(str(kpis_api.fetch_kpi(as_df=True)))

# '  tracker_token                             tracker_name  revenue
# 0        tsrdag  Facebook Installs::Expired Attributions  3627.54'

For more check out the documentation.

If you have any questions feel free to add issues or write to me.

TODO: Add link to Airflow hook and operator for AdjustApi

Metadata

Release files for python-adjust 1.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for python-adjust 1.0.3
File Interpreter ABI Platform Actions
python_adjust-1.0.3-py3-none-any.whl Python 3 none any Details for python_adjust-1.0.3-py3-none-any.whl

Release files / python_adjust-1.0.3-py3-none-any.whl

Download URL python_adjust-1.0.3-py3-none-any.whl
Size 6.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b8e165017147417712aff59f8398c93b851bd62589d9637cc38485e312427ba9
BLAKE2b-256 checksum
How to use checksums
c06d62658c478af7bc4e679aa77fff5738489247fb1df390d2754edc20739577
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.8.10

Security for python-adjust 1.0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page