火山Dataopen python 语言sdk
Project description
openapi 使用说明
Client 参数说明
| 字段 | 类型 | 默认值 | 含义 |
|---|---|---|---|
| app_id | str | 无 | 应用的唯一标识符 |
| app_secret | str | 无 | 用于应用的安全认证的密钥 |
| url | str or NoneType | "https://analytics.volcengineapi.com" | 服务器的 URL 地址 |
| expiration | str or NoneType | "1800" | 过期时间,单位是秒 |
client.request 参数说明
| 字段 | 类型 | 默认值 | 含义 |
|---|---|---|---|
| service_url | str | 无 | 请求的服务 URL 地址 |
| method | str | 无 | 请求的 HTTP 方法,例如 "GET", "POST" 等 |
| headers | Dict[str, str] | {} | 请求头,包含的信息如认证凭据,内容类型等 |
| params | Dict[str, any] | {} | URL 参数,用于 GET 请求 |
| body | Dict[str, any] | {} | 请求体,通常在 POST 或 PUT 请求中包含发送的数据 |
样例
1、Get 方法
from dataopen import Client, ParamsValueType
app_id = ""
app_secret = ""
dataopen_client = Client(app_id, app_secret)
headers = {}
params: dict[str, ParamsValueType] = {
"app": 46,
"page_size": 1,
"page": 1,
}
body = {}
res = dataopen_client.request("/dataopen/open-apis/xxx/openapi/v1/open/flight-list", "GET", headers, params, body)
print("\n\nOutput: ", res)
2、Post 方法
from dataopen import Client, ParamsValueType
app_id = ""
app_secret = ""
dataopen_client = Client(app_id, app_secret)
headers = {}
params = {}
body: dict[str, any] = {
"uid_list": ["1111111110000"],
}
res = dataopen_client.request(
"/dataopen/open-apis/xxx/openapi/v1/open/flight/version/6290880/add-test-user",
"POST",
headers,
params,
body,
)
# Output results
print("\n\nOutput: ", res)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dataopen_sdk_python-0.0.7-py3-none-any.whl.
File metadata
- Download URL: dataopen_sdk_python-0.0.7-py3-none-any.whl
- Upload date:
- Size: 8.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
60bf8f3f61abf11381a011089218a7b1d29c81ec8af1808a31558204a39e147a
|
|
| MD5 |
62c34f691ec79dc3c85e6a99bad408eb
|
|
| BLAKE2b-256 |
889732fdcffbb7f1c2574573f488eb94d66ec944a3011f0dc74ac3cdc2c9fe09
|