A Python wrapper around Apple App Store Api
Project description
App Store Connect Api
This is a Python wrapper around the Apple App Store Api : https://developer.apple.com/documentation/appstoreconnectapi
So far, it handles token generation / expiration, methods for listing resources and downloading reports.
Installation
The project is published on PyPI, install with:
pip install appstoreconnect
Usage
Please follow instructions on Apple documentation on how to generate an API key.
With your key ID, key file (you can either pass the path to the file or the content of it as a string) and issuer ID create a new API instance:
from appstoreconnect import Api
api = Api(key_id, path_to_key_file, issuer_id)
Here are a few examples of API usage. For a complete list of available methods please see api.py.
# list all apps
apps = api.list_apps()
for app in apps:
print(app.name, app.sku)
# sort resources
apps = api.list_apps(sort='name')
# filter apps
apps = api.list_apps(filters={'sku': 'DINORUSH', 'name': 'Dino Rush'})
print("%d apps found" % len(apps))
# read app information
app = api.read_app_information('1308363336')
print(app.name, app.sku, app.bundleId)
# get a related resource
for group in app.betaGroups():
print(group.name)
# list bundle ids
for bundle_id in api.list_bundle_ids():
print(bundle_id.identifier)
# list certificates
for certificate in api.list_certificates():
print(certificate.name)
# download sales report
api.download_sales_and_trends_reports(
filters={'vendorNumber': '123456789', 'frequency': 'WEEKLY', 'reportDate': '2019-06-09'}, save_to='report.csv')
# download finance report
api.download_finance_reports(filters={'vendorNumber': '123456789', 'reportDate': '2019-06'}, save_to='finance.csv')
Please note this is a work in progress, API is subject to change between versions.
Anonymous data collection
Starting with version 0.8.0 this library anonymously collects its usage to help better improve its development. What we collect is:
- a SHA1 hash of the issuer_id
- the OS and Python version used
- which enpoints had been used
You can review the source code
If you feel uncomfortable with it you can completely opt-out by initliazing the API with:
api = Api(key_id, path_to_key_file, issuer_id, submit_stats=False)
The is also an open issue about this topic where we would love to here your feedback and best practices.
Development
Project development happens on Github
TODO
- Support App Store Connect API 1.2
- handle POST, DELETE and PATCH requests
- sales report
- handle related resources
- allow to sort resources
- proper API documentation
- add tests
Credits
This project is developed by Ponytech
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file appstoreconnect-0.8.3.tar.gz
.
File metadata
- Download URL: appstoreconnect-0.8.3.tar.gz
- Upload date:
- Size: 12.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.20.1 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e65d21dd679090bfbf43611d2b4564cae6f7cdca1939be6bd4b855652ba49b1b |
|
MD5 | bd27149f71d88709cab12a935fddce37 |
|
BLAKE2b-256 | 82ebfdd151de0c40395912af0afaf1db6ddedbbc82844056336cb85e72716a51 |