Skip to main content

火山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

If you're not sure about the file name format, learn more about wheel file names.

dataopen_sdk_python-0.0.6-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file dataopen_sdk_python-0.0.6-py3-none-any.whl.

File metadata

File hashes

Hashes for dataopen_sdk_python-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 8c648c0c501f12af07b721efd8260b9bf5a3f1abdfa663e3d4008cee40d505aa
MD5 6d9e5643861e71360d6818b28eb9a149
BLAKE2b-256 35b9ce8bfa91dc2eea8d497d5b2770bba6620150d8afa9e457452751b13ece01

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page