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.7-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for dataopen_sdk_python-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 60bf8f3f61abf11381a011089218a7b1d29c81ec8af1808a31558204a39e147a
MD5 62c34f691ec79dc3c85e6a99bad408eb
BLAKE2b-256 889732fdcffbb7f1c2574573f488eb94d66ec944a3011f0dc74ac3cdc2c9fe09

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