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.17

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.17
File Size Uploaded Provenance Actions
py_acs_sdk-1.0.17.tar.gz 92.8 kB With provenance Details for py_acs_sdk-1.0.17.tar.gz

Built distribution (wheel)

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

Total release size: 220.7 kB

Release files / py_acs_sdk-1.0.17.tar.gz

Download URL py_acs_sdk-1.0.17.tar.gz
Size 92.8 kB
Tags Source
SHA-256 checksum
How to use checksums
e4277b5483db7e6c727be238c0bdd4fc4842cc1d24d363c6eae73413b29cf002
BLAKE2b-256 checksum
How to use checksums
ff924c9f78dcac67ffc1d4ef017bcf731c634473d2576cb484485855e138a1ce
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.17-py3-none-any.whl

Download URL py_acs_sdk-1.0.17-py3-none-any.whl
Size 127.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
aff106d494bfc0f229a54a88c91928d320c2da67b509e1b8b7a27334e24879f3
BLAKE2b-256 checksum
How to use checksums
2775614a92a72913f00a200501e9bba8b7f507f8edd6cc61a1c9b53c9493b185
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.17

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.17.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