Registry / aws / volcengine

volcengine

JSON →
library1.0.223pypypi✓ verified 85d ago

The `volcengine` library is the official Python SDK for interacting with Volcengine cloud services. It provides client interfaces for various services like STS, ECS, IAM, and more. It is actively maintained with frequent releases, often on a daily or weekly basis.

pip install volcengine
INSTALL
IMPORT
SIG · VOLCENGINE
V
volcengine
awspythonv1.0.223
Install
4.3s avg
Import
644ms
Disk
48MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.0.223 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
installs and imports cleanly · install 0.0s · import 0.670s · 47.9MB
glibc
py 3.103.910 runs
installs and imports cleanly · install 4.3s · import 0.618s · 49MB
48MB installed
● package 48MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

StsService
from volcengine.sts.StsService import StsService
Import the client for the Security Token Service (STS).
GetCallerIdentityRequest
from volcengine.sts.model.sts_pb2 import GetCallerIdentityRequest
Import specific request models, which are Protocol Buffer messages, from the service's 'model' submodule.
ECSService
from volcengine.ecs.ECSService import ECSService
General pattern for importing a service client, e.g., for Elastic Compute Service (ECS).

This quickstart initializes the Security Token Service (STS) client and calls `GetCallerIdentity` to retrieve the current user's identity. It expects `VOLCENGINE_ACCESSKEYID`, `VOLCENGINE_SECRETACCESSKEY`, and `VOLCENGINE_REGION` to be set as environment variables.

import os from volcengine.sts.StsService import StsService from volcengine.sts.model.sts_pb2 import GetCallerIdentityRequest # Initialize STS service client with credentials from environment variables sts_service = StsService() sts_service.set_ak(os.environ.get("VOLCENGINE_ACCESSKEYID", "")) sts_service.set_sk(os.environ.get("VOLCENGINE_SECRETACCESSKEY", "")) sts_service.set_region(os.environ.get("VOLCENGINE_REGION", "cn-beijing")) # Default to cn-beijing if not set # Create a request object req = GetCallerIdentityRequest() try: # Call the API resp = sts_service.get_caller_identity(req) # Print the response print("Successfully called GetCallerIdentity:") print(f" Account ID: {resp.AccountId}") print(f" User ID: {resp.UserId}") print(f" User Name: {resp.UserName}") except Exception as e: print(f"Error calling GetCallerIdentity: {e}")
Debug
Known issues
gotchaAuthentication requires correct `VOLCENGINE_ACCESSKEYID`, `VOLCENGINE_SECRETACCESSKEY`, and `VOLCENGINE_REGION` environment variables or explicit client configuration. Misconfiguration is the most common cause of API failures.
fix
Set the required environment variables (recommended for production) or use `client.set_ak()`, `client.set_sk()`, `client.set_region()` methods directly on the service client instance before making API calls.
affects: All 1.x.x
gotchaAPI request and response objects are typically Protocol Buffer messages, imported from `volcengine.<service_name>.model.<service_name>_pb2`. Failing to use these specific types can lead to `TypeError` or `AttributeError`.
fix
Always refer to the specific service's `model` submodule for the correct request and response types, e.g., `from volcengine.sts.model.sts_pb2 import GetCallerIdentityRequest`.
affects: All 1.x.x
gotchaEnsure `protobuf` and `grpcio` are correctly installed and compatible. Version mismatches between these core dependencies or with the SDK can lead to cryptic errors during API calls or client initialization.
fix
If encountering `TypeError` or `AttributeError` related to message objects or RPC communication, try `pip install --upgrade protobuf grpcio grpcio-tools` to ensure compatible versions.
affects: All 1.x.x
Errors
Common errors & fixes
No module named 'volcengine.ecs.ECSService'
The `volcengine` package or a specific service sub-module is not installed, or the import path is incorrect.
fix
Ensure the `volcengine` package is installed via `pip install volcengine`. Verify the exact import path against the official documentation or examples for the specific service you are trying to use.
Status code: 401, Error code: SignatureDoesNotMatch
The provided Volcengine AccessKey ID, Secret Access Key, or Region is incorrect or does not match the request signature.
fix
Double-check the `VOLCENGINE_ACCESSKEYID`, `VOLCENGINE_SECRETACCESSKEY`, and `VOLCENGINE_REGION` environment variables or the values passed to `set_ak()`, `set_sk()`, `set_region()` methods. Ensure they correspond to a valid Volcengine account and region.
AttributeError: 'StsService' object has no attribute 'get_caller_identity'
This usually indicates a typo in the API method name, using an outdated client version, or attempting to call a method that doesn't exist for the service/client.
fix
Verify the exact method name and its arguments in the official API documentation for your SDK version. Ensure your SDK is up to date with `pip install --upgrade volcengine`.
Upgrade
Version history
1.0.223latest on PyPI · released May 28, 2026
Audit
Dependencies
requestsrequiredUsed for HTTP communication with Volcengine API endpoints.
protobufrequiredCrucial for serializing and deserializing API requests and responses using Protocol Buffers.
grpciorequiredUnderlying RPC framework used for communication with Volcengine services.
grpcio-toolsrequiredUsed for compiling protobuf definitions, often a runtime dependency for SDKs.
Agent activity
65 hits · last 30 days
node
58
OpenAI (training)
1
Resources
volcengine — pip install volcengine · libregistry