# 简介
欢迎使用腾讯会议开发者工具套件(SDK)1.1.0,为方便 Python 开发者调试和接入腾讯云会议 API,这里向您介绍适用于 Python 的腾讯会议开发工具包,并提供首次使用开发工具包的简单示例。让您快速获取腾讯会议 Python SDK 并开始调用。
# 依赖环境
1. 依赖环境:Python 3.7 版本及以上。
2. 购买腾讯会议企业版获取 SecretID、SecretKey,接入的企业 AppId。
# 获取安装
在第一次使用云API之前,用户首先需要在腾讯云控制台上申请安全凭证,安全凭证包括 SecretID 和 SecretKey,SecretID 是用于标识 API 调用者的身份,SecretKey 是用于加密签名字符串和服务器端验证签名字符串的密钥 SecretKey 必须严格保管,避免泄露。
## 通过源码包安装
1. 前往 [Github 代码托管地址](https://git.code.tencent.com/open_sdk/openapi-sdk-python) 下载源码压缩包;
2. 解压源码包到您项目合适的位置;
3. 引用方法可参考示例。
# 示例
以创建会议接口为例:
```Python
import random
import time
import wemeet_openapi
# crete_meeting_demo 创建会议请求demo
def crete_meeting_demo():
# 1.构造 client 客户端(jwt 鉴权需要配置 appId sdkId secretID 和 secretKey)
client = wemeet_openapi.Client(app_id="2****46", sdk_id="2****50",
secret_id="Zk*****J8h",
secret_key="Y2z*****WRsVksn")
# 2.构造请求体
request = wemeet_openapi.ApiV1MeetingsPostRequest(
body=wemeet_openapi.V1MeetingsPostRequest(
instanceid=2,
meeting_type=0,
subject="测试会议",
type=1,
userid="userid",
start_time="1651334400",
end_time="1651377600"
)
)
# 3.构造 JWT 鉴权器
authenticator_builder = wemeet_openapi.JWTAuthenticator(
nonce=random.randrange(0, 2 ** 64),
timestamp=str(int(time.time()))
).options_build()
# 4.发送对应的请求
try:
response = client.meetings_api.v1_meetings_post(
request=request,
authenticator_options=[authenticator_builder])
print(f"Response from `MeetingsApi.V1MeetingsPost`: {vars(response)}\n")
except wemeet_openapi.ClientException as e:
print(f"Error when calling `MeetingsApi.V1MeetingsPost`: {e}\n")
except wemeet_openapi.ServiceException as svrErr:
print(f"Error when calling `MeetingsApi.V1MeetingsPost`: {svrErr}\n")
print(f"Full HTTP response: {str(svrErr.api_resp.raw_body)}\n")
# 调用入口点函数
if __name__ == "__main__":
crete_meeting_demo()
```
Raw data
{
"_id": null,
"home_page": "https://git.code.tencent.com/open_sdk/python",
"name": "wemeet-openapi",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": "",
"keywords": "Wemeet,OpenAPI SDK",
"author": "Leosluo",
"author_email": "leosluo@tencent.com",
"download_url": "https://files.pythonhosted.org/packages/2f/38/a344317c1d812c5e4302e135d984e7041b7f804bee5131981d72cf6db410/wemeet-openapi-1.0.0.17.tar.gz",
"platform": null,
"description": "# \u7b80\u4ecb\n\u6b22\u8fce\u4f7f\u7528\u817e\u8baf\u4f1a\u8bae\u5f00\u53d1\u8005\u5de5\u5177\u5957\u4ef6\uff08SDK\uff091.1.0\uff0c\u4e3a\u65b9\u4fbf Python \u5f00\u53d1\u8005\u8c03\u8bd5\u548c\u63a5\u5165\u817e\u8baf\u4e91\u4f1a\u8bae API\uff0c\u8fd9\u91cc\u5411\u60a8\u4ecb\u7ecd\u9002\u7528\u4e8e Python \u7684\u817e\u8baf\u4f1a\u8bae\u5f00\u53d1\u5de5\u5177\u5305\uff0c\u5e76\u63d0\u4f9b\u9996\u6b21\u4f7f\u7528\u5f00\u53d1\u5de5\u5177\u5305\u7684\u7b80\u5355\u793a\u4f8b\u3002\u8ba9\u60a8\u5feb\u901f\u83b7\u53d6\u817e\u8baf\u4f1a\u8bae Python SDK \u5e76\u5f00\u59cb\u8c03\u7528\u3002\n# \u4f9d\u8d56\u73af\u5883\n1. \u4f9d\u8d56\u73af\u5883\uff1aPython 3.7 \u7248\u672c\u53ca\u4ee5\u4e0a\u3002\n2. \u8d2d\u4e70\u817e\u8baf\u4f1a\u8bae\u4f01\u4e1a\u7248\u83b7\u53d6 SecretID\u3001SecretKey\uff0c\u63a5\u5165\u7684\u4f01\u4e1a AppId\u3002\n\n# \u83b7\u53d6\u5b89\u88c5\n\u5728\u7b2c\u4e00\u6b21\u4f7f\u7528\u4e91API\u4e4b\u524d\uff0c\u7528\u6237\u9996\u5148\u9700\u8981\u5728\u817e\u8baf\u4e91\u63a7\u5236\u53f0\u4e0a\u7533\u8bf7\u5b89\u5168\u51ed\u8bc1\uff0c\u5b89\u5168\u51ed\u8bc1\u5305\u62ec SecretID \u548c SecretKey\uff0cSecretID \u662f\u7528\u4e8e\u6807\u8bc6 API \u8c03\u7528\u8005\u7684\u8eab\u4efd\uff0cSecretKey \u662f\u7528\u4e8e\u52a0\u5bc6\u7b7e\u540d\u5b57\u7b26\u4e32\u548c\u670d\u52a1\u5668\u7aef\u9a8c\u8bc1\u7b7e\u540d\u5b57\u7b26\u4e32\u7684\u5bc6\u94a5 SecretKey \u5fc5\u987b\u4e25\u683c\u4fdd\u7ba1\uff0c\u907f\u514d\u6cc4\u9732\u3002\n\n## \u901a\u8fc7\u6e90\u7801\u5305\u5b89\u88c5\n1. \u524d\u5f80 [Github \u4ee3\u7801\u6258\u7ba1\u5730\u5740](https://git.code.tencent.com/open_sdk/openapi-sdk-python) \u4e0b\u8f7d\u6e90\u7801\u538b\u7f29\u5305\uff1b\n2. \u89e3\u538b\u6e90\u7801\u5305\u5230\u60a8\u9879\u76ee\u5408\u9002\u7684\u4f4d\u7f6e\uff1b\n3. \u5f15\u7528\u65b9\u6cd5\u53ef\u53c2\u8003\u793a\u4f8b\u3002\n\n# \u793a\u4f8b\n\n\u4ee5\u521b\u5efa\u4f1a\u8bae\u63a5\u53e3\u4e3a\u4f8b\uff1a\n```Python\nimport random\nimport time\n\nimport wemeet_openapi\n\n# crete_meeting_demo \u521b\u5efa\u4f1a\u8bae\u8bf7\u6c42demo\ndef crete_meeting_demo():\n\n # 1.\u6784\u9020 client \u5ba2\u6237\u7aef(jwt \u9274\u6743\u9700\u8981\u914d\u7f6e appId sdkId secretID \u548c secretKey)\n client = wemeet_openapi.Client(app_id=\"2****46\", sdk_id=\"2****50\",\n secret_id=\"Zk*****J8h\",\n secret_key=\"Y2z*****WRsVksn\")\n\n # 2.\u6784\u9020\u8bf7\u6c42\u4f53\n request = wemeet_openapi.ApiV1MeetingsPostRequest(\n body=wemeet_openapi.V1MeetingsPostRequest(\n instanceid=2,\n meeting_type=0,\n subject=\"\u6d4b\u8bd5\u4f1a\u8bae\",\n type=1,\n userid=\"userid\",\n start_time=\"1651334400\",\n end_time=\"1651377600\"\n )\n )\n\n # 3.\u6784\u9020 JWT \u9274\u6743\u5668\n authenticator_builder = wemeet_openapi.JWTAuthenticator(\n nonce=random.randrange(0, 2 ** 64),\n timestamp=str(int(time.time()))\n ).options_build()\n\n # 4.\u53d1\u9001\u5bf9\u5e94\u7684\u8bf7\u6c42\n try:\n response = client.meetings_api.v1_meetings_post(\n request=request,\n authenticator_options=[authenticator_builder])\n\n print(f\"Response from `MeetingsApi.V1MeetingsPost`: {vars(response)}\\n\")\n except wemeet_openapi.ClientException as e:\n print(f\"Error when calling `MeetingsApi.V1MeetingsPost`: {e}\\n\")\n\n except wemeet_openapi.ServiceException as svrErr:\n print(f\"Error when calling `MeetingsApi.V1MeetingsPost`: {svrErr}\\n\")\n print(f\"Full HTTP response: {str(svrErr.api_resp.raw_body)}\\n\")\n\n\n# \u8c03\u7528\u5165\u53e3\u70b9\u51fd\u6570\nif __name__ == \"__main__\":\n crete_meeting_demo()\n```\n\n\n",
"bugtrack_url": null,
"license": "",
"summary": "OpenAPI SDK for Python",
"version": "1.0.0.17",
"project_urls": {
"Homepage": "https://git.code.tencent.com/open_sdk/python",
"Source": "https://git.code.tencent.com/open_sdk/python"
},
"split_keywords": [
"wemeet",
"openapi sdk"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "9bdc724415528ce6528cc613d59690527146c464fb44d8339e65ee44a96ee283",
"md5": "dd6a4fea28d94a7014658d79dd7b40e3",
"sha256": "d3e18f4e785a12b64de955c6f884cc8bbf24aaa119c9e88dd525037a608949f0"
},
"downloads": -1,
"filename": "wemeet_openapi-1.0.0.17-py3-none-any.whl",
"has_sig": false,
"md5_digest": "dd6a4fea28d94a7014658d79dd7b40e3",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 98358,
"upload_time": "2024-01-17T10:20:07",
"upload_time_iso_8601": "2024-01-17T10:20:07.388732Z",
"url": "https://files.pythonhosted.org/packages/9b/dc/724415528ce6528cc613d59690527146c464fb44d8339e65ee44a96ee283/wemeet_openapi-1.0.0.17-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "2f38a344317c1d812c5e4302e135d984e7041b7f804bee5131981d72cf6db410",
"md5": "ec38326ed46a72f745b66d41496a8698",
"sha256": "b107e191df5a67a64942b68664767ba01fa34298eaad1c18a18d78e3eb5ffffc"
},
"downloads": -1,
"filename": "wemeet-openapi-1.0.0.17.tar.gz",
"has_sig": false,
"md5_digest": "ec38326ed46a72f745b66d41496a8698",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 42989,
"upload_time": "2024-01-17T10:20:10",
"upload_time_iso_8601": "2024-01-17T10:20:10.685618Z",
"url": "https://files.pythonhosted.org/packages/2f/38/a344317c1d812c5e4302e135d984e7041b7f804bee5131981d72cf6db410/wemeet-openapi-1.0.0.17.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-01-17 10:20:10",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "wemeet-openapi"
}