surquest-utils-appstoreconnect-analytics-api

Client library for AppStore Connect Analytics API


License
MIT
Install
pip install surquest-utils-appstoreconnect-analytics-api==0.0.1rc1

Documentation

GitHub GitHub Workflow Status (with branch) Coverage PyPI - Downloads PyPI

Introduction

This is a Python library for the AppStore Analytics API and allows you to easily access the analytics data of your python apps.

Installation

pip install surquest-utils-appstoreconnect-analytics-api

Usage

import datetime as dt
from surquest.utils.appstoreconnect.analytics import (
    Client as AppStoreConnectClient,
    Analytics as AppStoreConnectAnalytics,
    Formatter,
    Frequency,
    Measures,
    Dimension,
)

# Create client
client = AppStoreConnectClient(
    mayacinfo="ADD-YOUR-MYACINFO", # is a Cookie value from https://appstoreconnect.apple.com/
)

# Create analytics object
analytics = AppStoreConnectAnalytics(
    client=client
)

# Get time series data
data = analytics.get_time_series(
    app_ids=["ADD-YOUR-APP-ID"],
    measure=Measures.INSTALLS,
    start_date=dt.date(2021, 1, 1),
    end_date=dt.date(2021, 1, 31),
    grouping=Group.COUNTRY
    frequency=Frequency.DAY,
    )

print("YOUR DATA:", data)

Development

docker build `
     --tag surquest/utils/appstoreconnect:dev `
     --file package.base.dockerfile `
     --target test .

docker run --rm -it `
 -v "${pwd}:/opt/project" `
 -w "/opt/project/test" `
 -e "APPID={ADD-YOUR-APP-ID}" `
 -e "MYACINFO={ADD-YOUR-MYACINFO}" `
 surquest/utils/appstoreconnect:dev pytest

License

This project is licensed under the terms of the MIT license.