A Python SDK for interacting with the Cudo Compute REST API. Manage virtual machines, storage, networks, and other cloud resources programmatically.
- Async/Await Support - Built on
httpx
for efficient async operations - Type Safe - Comprehensive type hints with Pydantic models
- Full API Coverage - Complete support for VMs, storage, networking, and more
- Well Tested - 112 tests with 78% code coverage
- Great Documentation - Detailed docs with examples
pip install cudo-compute-sdk
uv add cudo-compute-sdk
import asyncio
from cudo_compute_sdk import CudoComputeSDK
async def main():
# Initialize the SDK with your API key
sdk = CudoComputeSDK(api_key="your-api-key-here")
try:
# List all projects
projects = await sdk.list_projects()
print(f"Found {len(projects)} projects")
# List VMs in a project
vms = await sdk.list_vms(project_id="my-project")
for vm in vms:
print(f"VM: {vm.id} - State: {vm.state}")
finally:
# Clean up
await sdk.close()
asyncio.run(main())
async def create_vm_example():
sdk = CudoComputeSDK(api_key="your-api-key")
try:
vm = await sdk.create_vm(
project_id="my-project",
vm_id="my-vm-001",
data_center_id="gb-bournemouth-1",
machine_type="standard",
boot_disk_image_id="ubuntu-2204-lts",
vcpus=2,
memory_gib=4,
gpus=0,
ssh_key_source="SSH_KEY_SOURCE_USER"
)
print(f"Created VM: {vm.id}")
print(f"IP Address: {vm.external_ip_address}")
finally:
await sdk.close()
async def storage_example():
sdk = CudoComputeSDK(api_key="your-api-key")
try:
# Create a disk
disk = await sdk.create_disk(
project_id="my-project",
disk_id="data-disk-001",
data_center_id="gb-bournemouth-1",
size_gib=100
)
# Attach to VM
await sdk.attach_disk(
project_id="my-project",
disk_id="data-disk-001",
vm_id="my-vm-001"
)
print(f"Created and attached disk: {disk.id}")
finally:
await sdk.close()
- Log in to Cudo Compute
- Navigate to your account settings
- Generate an API key
- Set it as an environment variable:
export CUDO_API_KEY="your-api-key-here"
Then use it in your code:
import os
from cudo_compute_sdk import CudoComputeSDK
sdk = CudoComputeSDK(api_key=os.getenv("CUDO_API_KEY"))
Visit the full project documentation: Cudo Compute SDK Docs
- Installation Guide - Detailed setup instructions
- Usage Examples - Common use cases and examples
- API Reference - Complete API documentation
- Architecture - SDK design and patterns
- Troubleshooting - Common issues and solutions
- Create, start, stop, reboot, terminate VMs
- Resize VMs (CPU, memory)
- List and get VM details
- Connect via web console
- Monitor VM metrics
- List available data centers
- Get machine type specifications
- Query pricing information
- Create and manage disks
- Attach/detach disks to VMs
- Create and manage NFS volumes
- Manage VM images (public and private)
- Create and manage virtual networks
- Configure security groups and rules
- Manage SSH keys
- List and manage projects
- View billing account information
# Clone the repository
git clone https://github.com/vantagecompute/cudo-compute-sdk.git
cd cudo-compute-sdk
# Install dependencies
uv sync --extra dev
# Run tests
just unit
# Run type checking
just typecheck
# Format code
just fmt
# Run linter
just lint
# Run all unit tests with coverage
just unit
# Run tests with verbose output
uv run pytest tests/unit -v
# Run specific test file
uv run pytest tests/unit/test_sdk.py -v
cudo-compute-sdk/
├── cudo_compute_sdk/
│ ├── __init__.py # Main SDK implementation
│ └── schema.py # Pydantic models for API data
├── tests/
│ └── unit/
│ ├── test_sdk.py # SDK method tests
│ └── test_schema.py # Schema model tests
├── docusaurus/ # Documentation site
├── justfile # Development task runner
├── pyproject.toml # Project configuration
└── README.md
We welcome contributions! Here's how to get started:
-
Fork the repository
git clone https://github.com/your-username/cudo-compute-sdk.git
-
Create a feature branch
git checkout -b feature/your-feature-name
-
Make your changes
- Write tests for new functionality
- Ensure all tests pass:
just unit
- Run type checking:
just typecheck
- Format code:
just fmt
-
Commit your changes
git commit -m "feat: add your feature description"
-
Push and create a Pull Request
git push origin feature/your-feature-name
- Python 3.12+ required
- Type hints on all public methods
- Docstrings for all public methods (Google style)
- Tests for all new functionality
- 80%+ test coverage for new code
just unit # Run unit tests with coverage
just typecheck # Run static type checking
just fmt # Format code with ruff
just lint # Run linters (codespell + ruff)
just docs-dev # Start documentation dev server
just docs-build # Build documentation
- Python 3.12 or higher
- Dependencies:
httpx
>= 0.28.1 (async HTTP client)pydantic
>= 2.0.0 (data validation)
This project is licensed under the Apache License 2.0.
See the LICENSE file for details.
- ✅ Free to use, modify, and distribute
- ✅ Commercial use permitted
- ✅ Patent rights granted
- ✅ Must include license and copyright notice
- ✅ Changes must be documented
- 📖 Documentation: https://vantagecompute.github.io/cudo-compute-sdk
- 🐛 Bug Reports: GitHub Issues
- 💬 Discussions: GitHub Discussions
- 📧 Email: support@vantagecompute.ai
Built with:
- httpx - Async HTTP client
- Pydantic - Data validation
- pytest - Testing framework
- Docusaurus - Documentation
Copyright 2025 Vantage Compute Corporation
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Made with ❤️ by Vantage Compute