Apache CloudStack Python SDK
A Python SDK for the Apache CloudStack API that provides a simple and type-safe interface to manage resources. All the available API action are documented here Apache CloudStack API
Features
- 🔐 Type-Safe - Built with Pydantic for request/response validation
- 🚀 Async Support - Built on httpx for modern async HTTP requests
- 📦 Easy Configuration - Simple configuration management
- 🧪 Well Tested - Comprehensive test suite with pytest
- 🔄 Automatic Retry - Built-in retry logic with exponential backoff
- 🔑 Request Signing - Automatic HMAC-SHA1 request signing
- 💻 CLI Tool - Command-line interface for quick operations
Requirements
- Python >= 3.12
Installation
pip install py-acs-sdk
Getting Started
Basic Setup
from acs_sdk import ApacheCloudStackClient, ApacheCloudStackConfig
# Create a configuration
config = ApacheCloudStackConfig(
endpoint="https://your-cloudstack-endpoint/api",
api_key="your_api_key",
api_secret="your_api_secret"
)
# Initialize the CloudStack client
client = ApacheCloudStackClient(config)
Making API Calls
# List users
response = client.call('listUsers')
# Get user with parameters
user_response = client.call('getUser', {'userid': '123'})
# Don't forget to close the client
client.close()
Async API Calls
import asyncio
from acs_sdk import ApacheCloudStackAsyncClient, ApacheCloudStackConfig
async def main():
config = ApacheCloudStackConfig(
endpoint="https://your-cloudstack-endpoint/api",
api_key="your_api_key",
api_secret="your_api_secret"
)
async with ApacheCloudStackAsyncClient(config) as client:
response = await client.call_async('listUsers')
print(response)
asyncio.run(main())
Command-Line Interface (CLI)
The SDK includes a CLI tool for quick operations without writing code.
Setup Environment Variables
export CLOUDSTACK_ENDPOINT="https://your-cloudstack-endpoint/api"
export CLOUDSTACK_API_KEY="your_api_key"
export CLOUDSTACK_API_SECRET="your_api_secret"
Available Commands
# List all regions
acs list-regions
# List all users
acs list-users
# View help
acs --help
acs list-regions --help
CLI Options
You can also provide options directly:
acs --endpoint "https://..." --api-key "..." --api-secret "..." list-regions
Project Structure
src/
├── acs_sdk/
│ ├── client/ # HTTP client implementation
│ ├── core/ # Retry logic and request signing
│ ├── schemas/ # Configuration schemas
│ ├── exceptions/ # Custom exceptions
│ └── cli.py # Command-line interface
tests/
├── unit/ # Unit tests
└── conftest.py # Pytest configuration
Development
Setup Development Environment
# Create virtual environment
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# Install dependencies with dev tools
pip install -e ".[dev]"
Running Tests
# Run all tests with coverage
pytest
# Run specific test file
pytest tests/unit/test_client.py
# Run with coverage report
pytest --cov=acs_sdk --cov-report=html
Code Structure
- Client - Handles HTTP requests to Apache CloudStack API
- Core - Retry logic and request signing utilities
- Schemas - Pydantic models for configuration validation
- CLI - Command-line interface for CloudStack operations
Dependencies
- httpx (>=0.28.1) - Modern HTTP client for async support
- pydantic (>=2.12.5) - Data validation and serialization
- click (>=8.3.1) - Command-line interface creation
License
MIT
Author
Vimal Saini - vimal.saini25@gmail.com
Metadata
Release files for py-acs-sdk 1.0.14
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| py_acs_sdk-1.0.14.tar.gz | 90.4 kB | With provenance | Details for py_acs_sdk-1.0.14.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| py_acs_sdk-1.0.14-py3-none-any.whl | Python 3 | none | any | Details for py_acs_sdk-1.0.14-py3-none-any.whl |
Total release size: 215.5 kB
Release files / py_acs_sdk-1.0.14.tar.gz
| Download URL | py_acs_sdk-1.0.14.tar.gz |
|---|---|
| Size | 90.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f9e5ab3d0e574ccbd1b01d6bbf8113d7005a3eb7b6f5b4cac739dba4046ec6b1
|
|
BLAKE2b-256 checksum How to use checksums |
df9bacff38cee1535a7d07487856fdc1bba6a6005063ddb457d5dc8ae14fa6b9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.
Transparency logRelease files / py_acs_sdk-1.0.14-py3-none-any.whl
| Download URL | py_acs_sdk-1.0.14-py3-none-any.whl |
|---|---|
| Size | 125.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f6aa35d969f1d171511920d67f6f5e7bc6357a57eac010f15becf53759da52ac
|
|
BLAKE2b-256 checksum How to use checksums |
bd081ea518e0a777088a69d5a85bd147f6e77351015a2a9858dc0ed805ee3363
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.
Transparency logSecurity for py-acs-sdk 1.0.14
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for py_acs_sdk-1.0.14.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.
Transparency logA 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.