# 简介
欢迎使用腾讯会议开发者工具套件(SDK),为方便 Python 开发者调试和接入腾讯云会议 API,这里向您介绍适用于 Python 的腾讯会议开发工具包,并提供首次使用开发工具包的简单示例。让您快速获取腾讯会议 Python SDK 并开始调用。
# 依赖环境
1. 依赖环境:Python 3.7 版本及以上。
2. 购买腾讯会议企业版获取 SecretID、SecretKey。SecretID 是用于标识 API 调用者的身份,SecretKey 是用于加密签名字符串和服务器端验证签名字符串的密钥 SecretKey 必须严格保管,避免泄露。
# 获取安装
有以下两种方式获取安装。
## 通过pip安装(推荐)
您可以通过 pip 安装方式将腾讯会议 OpenAPI Python SDK 安装到您的项目中。
请在命令行中执行以下命令:
```bash
pip install --upgrade wemeet-openapi-sdk-python
```
请注意,如果同时有 python2 和 python3 环境, python3 环境需要使用 pip3 命令安装。
## 通过源码包安装
1. 前往 [Github 代码托管地址](https://github.com/TencentCloud/wemeet-openapi-sdk-python) 下载源码压缩包;
2. 解压源码包到您项目合适的位置;
3. 使用如下命令安装:
```bash
cd wemeet-openapi-sdk-python
pip install .
```
# 示例
以创建会议接口为例:
```Python
import random
import time
import wemeet_openapi
# create_meeting_demo 创建会议请求demo
def create_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__":
create_meeting_demo()
```
Raw data
{
"_id": null,
"home_page": "https://github.com/TencentCloud/wemeet-openapi-sdk-python",
"name": "wemeet-openapi-sdk-python",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": "Wemeet, OpenAPI SDK",
"author": "Wemeet",
"author_email": "wemeet@tencent.com",
"download_url": "https://files.pythonhosted.org/packages/ab/c0/82442509bcd1d37293133c5442903c77b2d8618bb97387189a9541a80d67/wemeet_openapi_sdk_python-1.0.10.tar.gz",
"platform": null,
"description": "# \u7b80\u4ecb\r\n\u6b22\u8fce\u4f7f\u7528\u817e\u8baf\u4f1a\u8bae\u5f00\u53d1\u8005\u5de5\u5177\u5957\u4ef6\uff08SDK\uff09\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\r\n\r\n# \u4f9d\u8d56\u73af\u5883\r\n1. \u4f9d\u8d56\u73af\u5883\uff1aPython 3.7 \u7248\u672c\u53ca\u4ee5\u4e0a\u3002\r\n2. \u8d2d\u4e70\u817e\u8baf\u4f1a\u8bae\u4f01\u4e1a\u7248\u83b7\u53d6 SecretID\u3001SecretKey\u3002SecretID \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\r\n\r\n# \u83b7\u53d6\u5b89\u88c5\r\n\u6709\u4ee5\u4e0b\u4e24\u79cd\u65b9\u5f0f\u83b7\u53d6\u5b89\u88c5\u3002\r\n## \u901a\u8fc7pip\u5b89\u88c5\uff08\u63a8\u8350\uff09\r\n\u60a8\u53ef\u4ee5\u901a\u8fc7 pip \u5b89\u88c5\u65b9\u5f0f\u5c06\u817e\u8baf\u4f1a\u8bae OpenAPI Python SDK \u5b89\u88c5\u5230\u60a8\u7684\u9879\u76ee\u4e2d\u3002\r\n\u8bf7\u5728\u547d\u4ee4\u884c\u4e2d\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4:\r\n\r\n```bash\r\npip install --upgrade wemeet-openapi-sdk-python\r\n```\r\n\u8bf7\u6ce8\u610f\uff0c\u5982\u679c\u540c\u65f6\u6709 python2 \u548c python3 \u73af\u5883\uff0c python3 \u73af\u5883\u9700\u8981\u4f7f\u7528 pip3 \u547d\u4ee4\u5b89\u88c5\u3002\r\n## \u901a\u8fc7\u6e90\u7801\u5305\u5b89\u88c5\r\n1. \u524d\u5f80 [Github \u4ee3\u7801\u6258\u7ba1\u5730\u5740](https://github.com/TencentCloud/wemeet-openapi-sdk-python) \u4e0b\u8f7d\u6e90\u7801\u538b\u7f29\u5305\uff1b\r\n2. \u89e3\u538b\u6e90\u7801\u5305\u5230\u60a8\u9879\u76ee\u5408\u9002\u7684\u4f4d\u7f6e\uff1b\r\n3. \u4f7f\u7528\u5982\u4e0b\u547d\u4ee4\u5b89\u88c5\uff1a\r\n```bash\r\ncd wemeet-openapi-sdk-python\r\npip install .\r\n```\r\n\r\n# \u793a\u4f8b\r\n\r\n\u4ee5\u521b\u5efa\u4f1a\u8bae\u63a5\u53e3\u4e3a\u4f8b\uff1a\r\n```Python\r\nimport random\r\nimport time\r\n\r\nimport wemeet_openapi\r\n\r\n# create_meeting_demo \u521b\u5efa\u4f1a\u8bae\u8bf7\u6c42demo\r\ndef create_meeting_demo():\r\n\r\n # 1.\u6784\u9020 client \u5ba2\u6237\u7aef(jwt \u9274\u6743\u9700\u8981\u914d\u7f6e appId sdkId secretID \u548c secretKey)\r\n client = wemeet_openapi.Client(app_id=\"2****46\", sdk_id=\"2****50\",\r\n secret_id=\"Zk*****J8h\",\r\n secret_key=\"Y2z*****WRsVksn\")\r\n\r\n # 2.\u6784\u9020\u8bf7\u6c42\u4f53\r\n request = wemeet_openapi.ApiV1MeetingsPostRequest(\r\n body=wemeet_openapi.V1MeetingsPostRequest(\r\n instanceid=2,\r\n meeting_type=0,\r\n subject=\"\u6d4b\u8bd5\u4f1a\u8bae\",\r\n type=1,\r\n userid=\"userid\",\r\n start_time=\"1651334400\",\r\n end_time=\"1651377600\"\r\n )\r\n )\r\n\r\n # 3.\u6784\u9020 JWT \u9274\u6743\u5668\r\n authenticator_builder = wemeet_openapi.JWTAuthenticator(\r\n nonce=random.randrange(0, 2 ** 64),\r\n timestamp=str(int(time.time()))\r\n ).options_build()\r\n\r\n # 4.\u53d1\u9001\u5bf9\u5e94\u7684\u8bf7\u6c42\r\n try:\r\n response = client.meetings_api.v1_meetings_post(\r\n request=request,\r\n authenticator_options=[authenticator_builder])\r\n\r\n print(f\"Response from `MeetingsApi.V1MeetingsPost`: {vars(response)}\\n\")\r\n except wemeet_openapi.ClientException as e:\r\n print(f\"Error when calling `MeetingsApi.V1MeetingsPost`: {e}\\n\")\r\n\r\n except wemeet_openapi.ServiceException as svrErr:\r\n print(f\"Error when calling `MeetingsApi.V1MeetingsPost`: {svrErr}\\n\")\r\n print(f\"Full HTTP response: {str(svrErr.api_resp.raw_body)}\\n\")\r\n\r\n\r\n# \u8c03\u7528\u5165\u53e3\u70b9\u51fd\u6570\r\nif __name__ == \"__main__\":\r\n create_meeting_demo()\r\n```\r\n",
"bugtrack_url": null,
"license": null,
"summary": "OpenAPI SDK for Python",
"version": "1.0.10",
"project_urls": {
"Homepage": "https://github.com/TencentCloud/wemeet-openapi-sdk-python",
"Source": "https://github.com/TencentCloud/wemeet-openapi-sdk-python"
},
"split_keywords": [
"wemeet",
" openapi sdk"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "bb8757abfb005a0610181382000ba18c9da9aa0380252d4d69ea0b201c884911",
"md5": "3bc8ec2da3e4f8518656c5c14be276a9",
"sha256": "6434fd45e0c4a872d216e4e8a25d440cc1bd22a1914801069dcbe0a315a5b57e"
},
"downloads": -1,
"filename": "wemeet_openapi_sdk_python-1.0.10-py3-none-any.whl",
"has_sig": false,
"md5_digest": "3bc8ec2da3e4f8518656c5c14be276a9",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 152343,
"upload_time": "2025-07-15T03:57:08",
"upload_time_iso_8601": "2025-07-15T03:57:08.902536Z",
"url": "https://files.pythonhosted.org/packages/bb/87/57abfb005a0610181382000ba18c9da9aa0380252d4d69ea0b201c884911/wemeet_openapi_sdk_python-1.0.10-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "abc082442509bcd1d37293133c5442903c77b2d8618bb97387189a9541a80d67",
"md5": "762f8a06bf1af561ea290b45d2632d69",
"sha256": "b163de855e6ddb6ede7905c6d1e92098c8683b259d3acd60cf62f5cc47d00afc"
},
"downloads": -1,
"filename": "wemeet_openapi_sdk_python-1.0.10.tar.gz",
"has_sig": false,
"md5_digest": "762f8a06bf1af561ea290b45d2632d69",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 134736,
"upload_time": "2025-07-15T03:57:10",
"upload_time_iso_8601": "2025-07-15T03:57:10.583289Z",
"url": "https://files.pythonhosted.org/packages/ab/c0/82442509bcd1d37293133c5442903c77b2d8618bb97387189a9541a80d67/wemeet_openapi_sdk_python-1.0.10.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-15 03:57:10",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "TencentCloud",
"github_project": "wemeet-openapi-sdk-python",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "wemeet-openapi-sdk-python"
}