# 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/a1/d1/d75d7f8ec3d43e9ff7655e9a8e5819cdefe85ac05ea2da2d0898ade8baf0/appleapi-1.0.9.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.9",
"project_urls": {
"Homepage": "https://github.com/yingguqing/AppleAPI"
},
"split_keywords": [
"ios",
"apple",
"appstore",
"app",
"store",
"connect",
"api",
"appstoreconnectapi"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "83ec3d4fc141a2b16922480944ed0f1ddcebeb91c54934f5a045b3d2addc01a7",
"md5": "8d176309638b2951e553908220fbfc5a",
"sha256": "a090b5b25cb459bbebe2b8f036568ec2167bce5883675552a996557ec21c0d33"
},
"downloads": -1,
"filename": "AppleAPI-1.0.9-py3-none-any.whl",
"has_sig": false,
"md5_digest": "8d176309638b2951e553908220fbfc5a",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "~=3.7",
"size": 22255,
"upload_time": "2024-10-21T09:28:29",
"upload_time_iso_8601": "2024-10-21T09:28:29.929449Z",
"url": "https://files.pythonhosted.org/packages/83/ec/3d4fc141a2b16922480944ed0f1ddcebeb91c54934f5a045b3d2addc01a7/AppleAPI-1.0.9-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "a1d1d75d7f8ec3d43e9ff7655e9a8e5819cdefe85ac05ea2da2d0898ade8baf0",
"md5": "6495ac62b6d925d34b561490403c32e1",
"sha256": "bb9d94144f9849e2a16fb9e010f2786dad047fcd8e40fe82ff1bcb93d7c2d5f1"
},
"downloads": -1,
"filename": "appleapi-1.0.9.tar.gz",
"has_sig": false,
"md5_digest": "6495ac62b6d925d34b561490403c32e1",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "~=3.7",
"size": 20566,
"upload_time": "2024-10-21T09:28:31",
"upload_time_iso_8601": "2024-10-21T09:28:31.051281Z",
"url": "https://files.pythonhosted.org/packages/a1/d1/d75d7f8ec3d43e9ff7655e9a8e5819cdefe85ac05ea2da2d0898ade8baf0/appleapi-1.0.9.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-21 09:28:31",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "yingguqing",
"github_project": "AppleAPI",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "appleapi"
}