# AppleAPI
基于appstore connect api封装功能。
代码是基于[OKAppleAPI](https://github.com/shede333/OKAppleAPI)原码。只是在原代码基础上,新增了部分接口,封装了些自用功能。
## 安装
```
pip3 install appleapi
```
## 用法
```python
#!/usr/bin/python3
# coding=utf-8
from AppleAPI import AppStore
if __name__ == '__main__':
# 必填
issuer_id = 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'
# 必填
key_id = 'XXXXXXXXXX'
# 必填
key = """
-----BEGIN PRIVATE KEY-----
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXX
-----END PRIVATE KEY-----
"""
bundle_id = 'com.test.test.a.b'
name = 'Test'
email = 'test@test.com'
developer_name = 'Name'
country = 'US'
password = '123'
appstore_version = '1.0'
# 可以填写相对此文件的相对路径
screenshots = {
'zh-Hans' : {
"APP_IPHONE_67" : "C:/Users/Administrator/Desktop/python/iPhone14PM-6.7",
# "APP_IPHONE_65" : "iPhone11PM-6.5",
# "APP_IPHONE_55" : "iPhone8P-5.5",
# "APP_IPAD_PRO_3GEN_129" : "iPadPro-12.9",
# "APP_IPAD_PRO_129" : "iPadPro-12.9",
}
}
devices = {
'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx设备id' : '设备名称(可选),比如:iphone6s'
}
# https://developer.apple.com/documentation/appstoreconnectapi/capabilitytype
capabilitys = ['ASSOCIATED_DOMAINS'] # APPLE_ID_AUTH
app = AppStore(issuer_id, key_id, key, save_fold_name=email)
# 创建Bundle Id
app.create_bundle_id(bundle_id=bundle_id, bundle_name=name, capabilitys=capabilitys)
# 添加测试设备
app.add_devices(devices=devices)
# 创建证书
app.create_certificate(is_dev=False, email=email, developer_name=developer_name, password=password, country=country)
# 创建描述文件
app.create_profile(is_dev=False,bundle_id=bundle_id, name=name)
# 上传5图
app.upload_screenshot(bundle_id=bundle_id, appstore_version=appstore_version, screenshots=screenshots)
```
Raw data
{
"_id": null,
"home_page": "https://github.com/yingguqing/AppleAPI",
"name": "AppleAPI",
"maintainer": null,
"docs_url": null,
"requires_python": "~=3.7",
"maintainer_email": null,
"keywords": "ios apple appstore app store connect api appstoreconnectapi",
"author": "\u5f71\u5b64\u6e05",
"author_email": "yingguqing@163.com",
"download_url": "https://files.pythonhosted.org/packages/6d/f1/5eb5a9d00181ddae1f027c778a53c610e8f65ed49afdfe61c9dace32fe4b/appleapi-1.0.10.tar.gz",
"platform": null,
"description": "# AppleAPI\n\u57fa\u4e8eappstore connect api\u5c01\u88c5\u529f\u80fd\u3002\n\u4ee3\u7801\u662f\u57fa\u4e8e[OKAppleAPI](https://github.com/shede333/OKAppleAPI)\u539f\u7801\u3002\u53ea\u662f\u5728\u539f\u4ee3\u7801\u57fa\u7840\u4e0a\uff0c\u65b0\u589e\u4e86\u90e8\u5206\u63a5\u53e3\uff0c\u5c01\u88c5\u4e86\u4e9b\u81ea\u7528\u529f\u80fd\u3002\n\n## \u5b89\u88c5\n```\npip3 install appleapi\n```\n\n## \u7528\u6cd5\n\n```python\n#!/usr/bin/python3\n# coding=utf-8\n\nfrom AppleAPI import AppStore\n\n\nif __name__ == '__main__':\n # \u5fc5\u586b\n issuer_id = 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \n # \u5fc5\u586b\n key_id = 'XXXXXXXXXX' \n # \u5fc5\u586b\n key = \"\"\"\n -----BEGIN PRIVATE KEY-----\n XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n XXXXXXXX\n -----END PRIVATE KEY----- \n \"\"\"\n\n bundle_id = 'com.test.test.a.b'\n name = 'Test'\n email = 'test@test.com'\n developer_name = 'Name'\n country = 'US'\n password = '123'\n appstore_version = '1.0'\n # \u53ef\u4ee5\u586b\u5199\u76f8\u5bf9\u6b64\u6587\u4ef6\u7684\u76f8\u5bf9\u8def\u5f84\n screenshots = {\n 'zh-Hans' : {\n \"APP_IPHONE_67\" : \"C:/Users/Administrator/Desktop/python/iPhone14PM-6.7\",\n # \"APP_IPHONE_65\" : \"iPhone11PM-6.5\",\n # \"APP_IPHONE_55\" : \"iPhone8P-5.5\",\n # \"APP_IPAD_PRO_3GEN_129\" : \"iPadPro-12.9\",\n # \"APP_IPAD_PRO_129\" : \"iPadPro-12.9\",\n }\n } \n devices = {\n 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\u8bbe\u5907id' : '\u8bbe\u5907\u540d\u79f0(\u53ef\u9009)\uff0c\u6bd4\u5982\uff1aiphone6s'\n }\n # https://developer.apple.com/documentation/appstoreconnectapi/capabilitytype\n capabilitys = ['ASSOCIATED_DOMAINS'] # APPLE_ID_AUTH\n app = AppStore(issuer_id, key_id, key, save_fold_name=email)\n # \u521b\u5efaBundle Id\n app.create_bundle_id(bundle_id=bundle_id, bundle_name=name, capabilitys=capabilitys)\n # \u6dfb\u52a0\u6d4b\u8bd5\u8bbe\u5907\n app.add_devices(devices=devices)\n # \u521b\u5efa\u8bc1\u4e66\n app.create_certificate(is_dev=False, email=email, developer_name=developer_name, password=password, country=country)\n # \u521b\u5efa\u63cf\u8ff0\u6587\u4ef6\n app.create_profile(is_dev=False,bundle_id=bundle_id, name=name)\n # \u4e0a\u4f205\u56fe\n app.upload_screenshot(bundle_id=bundle_id, appstore_version=appstore_version, screenshots=screenshots)\n\n```\n\n\n\n",
"bugtrack_url": null,
"license": null,
"summary": "App Store Connect API",
"version": "1.0.10",
"project_urls": {
"Homepage": "https://github.com/yingguqing/AppleAPI"
},
"split_keywords": [
"ios",
"apple",
"appstore",
"app",
"store",
"connect",
"api",
"appstoreconnectapi"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "d8174dc95cc93106f9c6df9925e0a4b7d6106a444420aae085a530b280051e45",
"md5": "79f7e3ce6f53e5ddbb8c46bf8eb262cb",
"sha256": "f07f1cbf4c62df603c4de1afd1e4f040014064fe8135185a119d0cbdf456aafe"
},
"downloads": -1,
"filename": "appleapi-1.0.10-py3-none-any.whl",
"has_sig": false,
"md5_digest": "79f7e3ce6f53e5ddbb8c46bf8eb262cb",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "~=3.7",
"size": 22368,
"upload_time": "2025-07-28T08:23:46",
"upload_time_iso_8601": "2025-07-28T08:23:46.355675Z",
"url": "https://files.pythonhosted.org/packages/d8/17/4dc95cc93106f9c6df9925e0a4b7d6106a444420aae085a530b280051e45/appleapi-1.0.10-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "6df15eb5a9d00181ddae1f027c778a53c610e8f65ed49afdfe61c9dace32fe4b",
"md5": "0b5c9cef61f6603ba0b4dafc11f783ad",
"sha256": "6b49606c664c6d7f680f68210bb584a5e9ef6b985c53c52edb5774e64349919e"
},
"downloads": -1,
"filename": "appleapi-1.0.10.tar.gz",
"has_sig": false,
"md5_digest": "0b5c9cef61f6603ba0b4dafc11f783ad",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "~=3.7",
"size": 20657,
"upload_time": "2025-07-28T08:23:47",
"upload_time_iso_8601": "2025-07-28T08:23:47.508921Z",
"url": "https://files.pythonhosted.org/packages/6d/f1/5eb5a9d00181ddae1f027c778a53c610e8f65ed49afdfe61c9dace32fe4b/appleapi-1.0.10.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-28 08:23:47",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "yingguqing",
"github_project": "AppleAPI",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "appleapi"
}