GithubHelp home page GithubHelp logo

appstore-tools's Introduction

appstore-tools

Tools for the AppStore Connect API.

This package provides methods to publish, download, and list information about AppStore meta-data (descriptions, keywords, screenshots, previews, etc). Combined with a deployment workflow (such as github actions), the AppStore meta-data can be tracked and deployed along side the rest of the app's source code and assets.

Install

pip install appstore-tools

Usage

appstore-tools [-h] [--version] action [args]

Examples:

# List all apps under the app store account
appstore-tools apps

# Download the assets for an app
appstore-tools download --bundle-id com.example.myapp --asset-dir myassets

# Publish the assets for an app
appstore-tools publish --bundle-id com.example.myapp --asset-dir myassets

Usage Config

Most actions will require authentication with the AppStore Connect API, as well as specifying which app to target.

All these parameters can be passed via command line argument, but for convenience, they (and any others) can also be loaded from a config file.

Use the default config file path of appstore_tools.config, or specify another with --config-file CONFIG_FILE.

; appstore_tools.config
; sample contents
issuer-id=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
key-id=XXXXXXXXXX
key-file=/home/me/AppStoreConnect_AuthKey_XXXXXXXXXX.p8
bundle-id=com.example.myapp

Code

The actions provided by the command line can also be accessed by import in a python script.

# Import the package
from appstore_tools import appstore, actions

# Get the auth credentials
with open("AuthKey.p8", "r") as file:
    key = file.read()

issuer_id="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
key_id="XXXXXXXXXX"

# Create an access token
access_token = appstore.create_access_token(
    issuer_id=issuer_id, key_id=key_id, key=key
)

# Call the AppStore connect API
apps = appstore.get_apps(access_token=access_token)

# Or call one of the AppStore-Tools Actions
actions.list_apps(access_token=access_token)

Asset Directory Structure

The download and publish actions look for assets in the following directory structure starting at --asset-dir ASSET_DIR. Screenshots and Previews are sorted alphabetically in the store listing.

To leave an attribute unaffected by the publish action, remove the corresponding text file from the tree. An empty text file can be used to set the attribute to an empty string.

Likewise, to leave the screenshots (or previews) unaffected, remove the entire screenshots folder. If screenshots is present, the publish action will add/remove screenshot-display-types and their screenshots to match.

Additionally, filepaths can be explicitly ignored by setting a regex pattern with --asset-ignore ASSET_IGNORE.

[ASSET_DIR]
└── com.example.myapp
    └── en-US
        ├── description.txt
        ├── keywords.txt
        ├── marketingUrl.txt
        ├── name.txt
        ├── previews
        │   └── IPHONE_65
        │       ├── video.mp4
        │       └── video.mp4.json
        ├── privacyPolicyText.txt
        ├── privacyPolicyUrl.txt
        ├── promotionalText.txt
        ├── screenshots
        │   ├── APP_IPAD_PRO_129
        │   │   ├── 10_Image.png
        │   │   ├── 20_AnotherImage.png
        │   │   └── 30_MoreImages.png
        │   ├── APP_IPAD_PRO_3GEN_129
        │   │   ├── a_is_the_first_letter.png
        │   │   ├── b_is_the_second_letter.png
        │   │   └── c_is_the_third_letter.png
        │   ├── APP_IPHONE_55
        │   │   ├── image01.png
        │   │   ├── image02.png
        │   │   └── image03.png
        │   └── APP_IPHONE_65
        │       ├── image01.png
        │       ├── image02.png
        │       └── image03.png
        ├── subtitle.txt
        ├── supportUrl.txt
        └── whatsNew.txt

Additional attributes for media files can be set by placing a json file with a matching base file name along side the media file. For example, the contents of video.mp4.json (along side video.mp4) could look like this:

{
  "previewFrameTimeCode": "00:00:14:01"
}

Source

Clone the source code

git clone https://github.com/bennord/appstore-tools.git

Install dependencies

poetry install

Run from within project environment

poetry shell
appstore-tools --version

appstore-tools's People

Contributors

bennord avatar bennordgengo avatar luke14free avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

luke14free

appstore-tools's Issues

Preview time frame code could be 00:00 by default

A good compromise between implementing complex features for the app preview frame, would be to set it to 00:00 by default , so that designers/motion designers can export videos with the poster frame as the first (or first few) frame(s) of the video. WDYT?

Non-changed assets are being re-uploaded

I did a simple appstore-tools download ..., created a version on appstore connect and did an appstore-tools upload ... without changing anything. However I believe that the upload script has some issues understanding that the assets did not change and is re-uploading all of them; e.g.

  tr    - updating locale ['whatsNew']
    APP_IPHONE_65 - checking for changes
      1-1.jpg - checksum changed: a89e18b40b9e13dc0d58e09c559dbf9b -> a6119e9477d6791b8bc36b2842e8351a
      3-1.jpg - checksum changed: ff37e7308ae925858834c905b666247c -> 7d270e6d689cda001799f87368b58e59
      2-1.jpg - checksum changed: e96db50772cff91b273f9a83b3850078 -> 9559bc027e9de4e942b2b791b3b3c8d7
      4-1.jpg - checksum changed: c7f5cc63c3712d6cc107e976d3678fca -> 1a01d4a0d05dcae0f41cb79ab7c06c05
      5-1.jpg - checksum changed: 7d80e362a55013d18294034eb3f9ce80 -> df55a25e49dddb8d93f5528d26238cb3

Script hangs before downloading any asset

$ appstore-tools download --bundle-id xxxx  --asset-dir myassets
xxxx 123 -> myassets/xxxx
READY_FOR_SALE - downloading app info
  sv    - downloading info locale
  hi    - downloading info locale
  id    - downloading info locale
  en-CA - downloading info locale
  hr    - downloading info locale
  uk    - downloading info locale
  fr-CA - downloading info locale
  pt-BR - downloading info locale
  de-DE - downloading info locale
  ar-SA - downloading info locale
  cs    - downloading info locale
  ru    - downloading info locale
  vi    - downloading info locale
  en-GB - downloading info locale
  ja    - downloading info locale
  tr    - downloading info locale
  hu    - downloading info locale
  ms    - downloading info locale
  he    - downloading info locale
  zh-Hant - downloading info locale
  en-AU - downloading info locale
  no    - downloading info locale
  sk    - downloading info locale
  da    - downloading info locale
  th    - downloading info locale
  nl-NL - downloading info locale
  pl    - downloading info locale
  pt-PT - downloading info locale
  el    - downloading info locale
  fi    - downloading info locale
  es-ES - downloading info locale
  ko    - downloading info locale
  ro    - downloading info locale
  zh-Hans - downloading info locale
  it    - downloading info locale
  es-MX - downloading info locale
  fr-FR - downloading info locale
  en-US - downloading info locale
READY_FOR_SALE {IOS} - downloading app version asset list

and hangs afterwards

Credentials expired while uploading

I have an app localized in all locales, and thus it takes a long time to update (also connected to issue #3 ). Therefore at a certain point I got:

      myassets/xxxx/ro/screenshots/APP_IPHONE_55/2.jpg - uploading chunk (offset: 0, length: 223119)
      2.jpg - commiting upload
https://api.appstoreconnect.apple.com/v1/appScreenshots/... PATCH (HttpError 401)
{
  "request": {
    "data": {
      "id": "yyy",
      "attributes": {
        "uploaded": true,
        "sourceFileChecksum": "62241a33e90418241cc4875e7de854de"
      },
      "type": "appScreenshots"
    }
  },
  "response": {
    "errors": [
      {
        "status": "401",
        "code": "NOT_AUTHORIZED",
        "title": "Authentication credentials are missing or invalid.",
        "detail": "Provide a properly configured and signed bearer token, and make sure that it has not expired. Learn more about Generating Tokens for API Requests https://developer.apple.com/go/?id=api-generating-tokens"
      }
    ]
  }
}

Which I believe is because auth expired halfway through uploading

Prevent .DS_Store files from being uploaded

on mac osx you will typically have .DS_Store files automatically generated by finder. It would probably be better to prevent their upload

      /.../sv/previews/IPHONE_65/.DS_Store - uploading chunk (offset: 0, length: 6148)
      .DS_Store - commiting upload

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.