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)
Metadata
Release files for dataopen-sdk-python 0.0.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| dataopen_sdk_python-0.0.7-py3-none-any.whl | Python 3 | none | any | Details |
Release files / dataopen_sdk_python-0.0.7-py3-none-any.whl
| Download URL | dataopen_sdk_python-0.0.7-py3-none-any.whl |
|---|---|
| Size | 8.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
60bf8f3f61abf11381a011089218a7b1d29c81ec8af1808a31558204a39e147a
|
|
BLAKE2b-256 checksum How to use checksums |
889732fdcffbb7f1c2574573f488eb94d66ec944a3011f0dc74ac3cdc2c9fe09
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.8.9
|
Security for dataopen-sdk-python 0.0.7
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.