Skip to main content

OK AppStore Connect API

Project description

OK App Store Connect API

Apple官方API文档:https://developer.apple.com/documentation/appstoreconnectapi

同时,也借鉴了 appstoreconnect库 的设计;

功能

profile,即mobileprovision文件;
device,即设备(iPhone、iPad等),包括设备的name、UDID信息;

  • 获取profile列表;
  • 删除一个profile;
  • 创建一个profile;
  • 获取bundleId列表;
  • 获取Certificate证书信息列表;
  • 获取device列表;
  • 注册一个新device

使用

from okappleapi.apple_api_agent import APIAgent, TokenManager
from okappleapi.models import *
from pathlib import Path

# key参数 支持key文件内容,或者key文件路径(即*.p8文件路径)
token_manager = TokenManager(issuer_id='xxx', key_id='xxx', key='xxx')
# TokenManager.from_json(key_path)  # 读取配置文件来创建对象

agent = APIAgent(token_manager)

# 获取certificates列表
cer_list = agent.list_certificates()
for tmp_cer in cer_list:
    print(f'{tmp_cer.id}, {tmp_cer.attributes.__dict__}')

# 获取bundle_id列表
bundle_id_list = agent.list_bundle_id()
for tmp_id in bundle_id_list:
    print(f'{tmp_id.id}, {tmp_id.attributes}')

# 获取device设备列表
device_list = agent.list_devices()
for tmp_device in device_list:
    print(tmp_device.__dict__)

# 获取profile列表
profile_list = agent.list_profiles()
for index, tmp_profile in enumerate(profile_list, start=1):
    print(f"profile: {index}. {tmp_profile.id}, {tmp_profile.attributes.name}")

# 创建profile
attrs = ProfileCreateReqAttrs('test_hello')
result = agent.create_a_profile(attrs, bundle_id=bundle_id_list[0], devices=device_list, certificates=cer_list)
print(f'create profile: {result.id}, {result.attributes.name}')

# 删除刚创建的profile
agent.delete_a_profile(result.id)

# 添加一个iOS新设备
device_name = 'xxx'
device_udid = 'xxx'
result = agent.register_a_device(DeviceCreateReqAttrs(device_name, device_udid))
print(result)


# 更新一个profile
from okappleapi.ok_agent import OKProfileManager

profile_name = 'test_hello'
bundle_id_str = 'com.oksw.hellotest'
ok_agent = OKProfileManager(token_manager)
ok_agent.update_profile(profile_name, bundle_id_str=bundle_id_str)

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

OKAppleAPI-1.0.0.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

OKAppleAPI-1.0.0-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

Details for the file OKAppleAPI-1.0.0.tar.gz.

File metadata

  • Download URL: OKAppleAPI-1.0.0.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.0

File hashes

Hashes for OKAppleAPI-1.0.0.tar.gz
Algorithm Hash digest
SHA256 ed5f510899904e0e8a067dcb00b5f3e79dcb1a6f1293f7d4225be346026e27dd
MD5 53c3c79f64ea39c5aafaa7e7237b5316
BLAKE2b-256 a92e9b2becc94e0b9cd202dfce40ff38cccff51ce17a3931b179bea18bbe377e

See more details on using hashes here.

File details

Details for the file OKAppleAPI-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: OKAppleAPI-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 10.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.0

File hashes

Hashes for OKAppleAPI-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c81463fb6e2b7ee0f1b13f035a1b6c6311fdf5150a3ab335a13adba700f8eb03
MD5 8438f05977ce4571ff5d3787240d1798
BLAKE2b-256 b1c004ba3794f953663fc60562788a8f66e6044954f8a871bf70f5bde870ef37

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page