Skip to main content

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(
    api_endpoint="https://your-cloudstack-endpoint/api",
    api_key="your_api_key",
    api_secret="your_api_secret"
)

Making API Calls

# The context manager closes the connection pool when done
with ApacheCloudStackClient(config) as client:
    # List users
    response = client.call('listUsers')

    # Get user with parameters
    user_response = client.call('getUser', {'userid': '123'})

Async API Calls

import asyncio
from acs_sdk import ApacheCloudStackAsyncClient, ApacheCloudStackConfig

async def main():
    config = ApacheCloudStackConfig(
        api_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.16

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for py-acs-sdk 1.0.16
File Size Uploaded Provenance Actions
py_acs_sdk-1.0.16.tar.gz 92.3 kB With provenance Details for py_acs_sdk-1.0.16.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for py-acs-sdk 1.0.16
File Interpreter ABI Platform Actions
py_acs_sdk-1.0.16-py3-none-any.whl Python 3 none any Details for py_acs_sdk-1.0.16-py3-none-any.whl

Total release size: 219.5 kB

Release files / py_acs_sdk-1.0.16.tar.gz

Download URL py_acs_sdk-1.0.16.tar.gz
Size 92.3 kB
Tags Source
SHA-256 checksum
How to use checksums
881e39af3d946c4b67e16aa2bbc3562a9dbab62bb5ec1f12073a0fb423b68c49
BLAKE2b-256 checksum
How to use checksums
69ec6a51de69e103f2b51938011a8ccd1ed30c1c4b47e435f90ac97172224ab3
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 29, 2026.

Transparency log

Release files / py_acs_sdk-1.0.16-py3-none-any.whl

Download URL py_acs_sdk-1.0.16-py3-none-any.whl
Size 127.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0e040d78ec04afa8c3e09b10521d84f3a129f58da85e4f9bda32c64f6df2a2e1
BLAKE2b-256 checksum
How to use checksums
99e3782d7665a6f25d231ffb1fdf95c458a41b5f4a45bc9d2f80faeeab5f00f5
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 29, 2026.

Transparency log

Security for py-acs-sdk 1.0.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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for py_acs_sdk-1.0.16.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 29, 2026.

Transparency log

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page