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

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.15
File Size Uploaded Provenance Actions
py_acs_sdk-1.0.15.tar.gz 92.0 kB With provenance Details for py_acs_sdk-1.0.15.tar.gz

Built distribution (wheel)

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

Total release size: 218.9 kB

Release files / py_acs_sdk-1.0.15.tar.gz

Download URL py_acs_sdk-1.0.15.tar.gz
Size 92.0 kB
Tags Source
SHA-256 checksum
How to use checksums
e068b86dbf395c5889971f045781f240c6f08019b69f1aa72197520a6ab1caeb
BLAKE2b-256 checksum
How to use checksums
51e7777148452a5261064fbe2d2e423674b3238c8bd96cd0b9d821ad61092bd5
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.15-py3-none-any.whl

Download URL py_acs_sdk-1.0.15-py3-none-any.whl
Size 126.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
970bcde85a00d255b5219c6788503aca7d9846e6c24bfd83557b7940a538536a
BLAKE2b-256 checksum
How to use checksums
ee3dacefb16bb02deea20f388b4ab08071eb8c0d987c57cb3b107cee1a062cc9
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.15

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