Skip to main content

A unified multi-cloud SDK for AWS and GCP services

Project description

Cloudjack

A unified Python SDK for interacting with cloud services across multiple providers (AWS, GCP) through a single, consistent interface.

Features

  • Universal Factory — One function to create any cloud service client, regardless of provider.
  • Secret Manager — CRUD operations for secrets (AWS Secrets Manager, GCP Secret Manager).
  • Cloud Storage — CRUD operations for buckets and objects (AWS S3).
  • Provider-agnostic interfaces — Swap cloud providers without changing your application code.
  • Typed returns@overload annotations give your IDE full autocomplete on returned service objects.

Project Structure

cloudjack/
├── main.py                  # Entry point
├── pyproject.toml
├── cloud/
│   ├── __init__.py          # Exports universal_factory
│   ├── factory.py           # Universal factory with provider registry
│   ├── base/
│   │   ├── __init__.py
│   │   ├── secret_manager.py   # SecretManagerBlueprint (ABC)
│   │   ├── storage.py          # CloudStorageBlueprint (ABC)
│   │   └── exceptions.py       # Shared exception classes
│   ├── aws/
│   │   ├── __init__.py
│   │   ├── factory.py          # AWS service registry
│   │   ├── secret_manager.py   # AWS Secrets Manager implementation
│   │   └── storage.py          # AWS S3 implementation
│   └── gcp/
│       ├── __init__.py
│       ├── factory.py          # GCP service registry
│       └── secret_manager.py   # GCP Secret Manager implementation

Installation

Requires Python >= 3.14.

uv sync

Usage

Secret Manager

from cloud import universal_factory

# AWS
client = universal_factory(
    service_name="secret_manager",
    cloud_provider="aws",
    config={
        "aws_access_key_id": "...",
        "aws_secret_access_key": "...",
        "region_name": "ap-south-1",
    },
)

secret = client.get_secret("my_secret")
client.create_secret("new_secret", "s3cr3t_value")
client.update_secret("new_secret", "updated_value")
client.delete_secret("new_secret")

# GCP — same interface, different provider
client = universal_factory(
    service_name="secret_manager",
    cloud_provider="gcp",
    config={...},
)

Cloud Storage (AWS S3)

from cloud import universal_factory

storage = universal_factory(
    service_name="storage",
    cloud_provider="aws",
    config={
        "aws_access_key_id": "...",
        "aws_secret_access_key": "...",
        "region_name": "us-east-1",
    },
)

# Buckets
storage.create_bucket("my-bucket")
buckets = storage.list_buckets()
storage.delete_bucket("my-bucket")

# Objects
storage.upload_file("my-bucket", "data.csv", "/local/data.csv")
storage.download_file("my-bucket", "data.csv", "/local/copy.csv")
content = storage.get_object("my-bucket", "data.csv")
keys = storage.list_objects("my-bucket", prefix="data/")
storage.delete_object("my-bucket", "data.csv")

# Pre-signed URLs
url = storage.generate_signed_url("my-bucket", "data.csv", expiration=3600)

Adding a New Cloud Provider

  1. Create a directory under cloud/<provider>/.
  2. Implement service classes inheriting from the base blueprints (SecretManagerBlueprint, CloudStorageBlueprint).
  3. Create a factory.py with a SERVICE_REGISTRY dict mapping service names to classes.
  4. Register it in cloud/factory.py under _FACTORY_REGISTRY.

Exceptions

Exception Description
SecretManagerError Base exception for secret manager operations
SecretNotFoundError Secret does not exist
SecretAlreadyExistsError Secret already exists
StorageError Base exception for storage operations
BucketNotFoundError Bucket does not exist
BucketAlreadyExistsError Bucket already exists
ObjectNotFoundError Object does not exist

License

MIT

Roadmap

Proposals and future work to make Cloudjack a production-ready library.

Providers

  • Azure support — Implement Azure Blob Storage and Azure Key Vault behind the existing blueprints.
  • DigitalOcean Spaces — S3-compatible, minimal adapter needed.

New Service Blueprints

  • Queue/Messaging — Unified interface for AWS SQS, GCP Pub/Sub, Azure Service Bus.
  • IAM/Auth — Role and policy management across providers.
  • DNS — Route53, Cloud DNS, Azure DNS under one blueprint.
  • Compute — Basic VM lifecycle (create, start, stop, terminate).
  • Logging — CloudWatch Logs, Cloud Logging, Azure Monitor.

Core Improvements

  • Async support — Async variants of all service methods via asyncio.to_thread + AsyncMixin.
  • Connection pooling — Singleton ClientCache reuses clients per provider+config.
  • Retry policies — Configurable retry/backoff decorator in cloud.base.retry.
  • Config validation — Pydantic models for provider configs (AWSConfig, GCPConfig).
  • Credential chain — Auto-resolve credentials from env vars via Pydantic model_validator.
  • Logging & observability — Structured JSON logging with request IDs in cloud.base.logger.

Packaging & Distribution

  • Publish to PyPI — Proper packaging with extras (pip install cloudjack[aws], cloudjack[gcp]). Use ./publish.sh.
  • Optional dependencies — Only install boto3 if using AWS, google-cloud-* if using GCP.
  • CLI toolcloudjack --provider aws --service storage list-buckets.

Testing & CI

  • Integration tests — Test against real cloud APIs (LocalStack for AWS, emulator for GCP) in CI.
  • Coverage reporting — Enforce minimum coverage threshold (80%) in pyproject.toml.
  • GitHub Actions workflow — Automated lint, test, type-check on push/PR.
  • Type checkingmypy config in pyproject.toml, runs in CI.

Documentation

  • API reference — Auto-generated from docstrings via mkdocs + mkdocstrings. Run uv run mkdocs serve.
  • Migration guidedocs/migration.md — switching from raw SDKs to Cloudjack.
  • Contributing guideCONTRIBUTING.md — standards for adding providers and services.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cloudjack-0.1.0.tar.gz (107.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cloudjack-0.1.0-py3-none-any.whl (51.9 kB view details)

Uploaded Python 3

File details

Details for the file cloudjack-0.1.0.tar.gz.

File metadata

  • Download URL: cloudjack-0.1.0.tar.gz
  • Upload date:
  • Size: 107.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for cloudjack-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5e26e1dd7d6a0d97a08d45599b520964eeb6fc060ac82b0462ba8f2ad30971d3
MD5 ecbb058d1640ddda3ff78574eef7cb51
BLAKE2b-256 4687a472263993293375e95572d295c2fd498e62a5812a071c94ae3eb27b619d

See more details on using hashes here.

File details

Details for the file cloudjack-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: cloudjack-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 51.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for cloudjack-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 85a6a8c4bb4d2552c2c6e1c63beca9d8c9fed28dd958ee7bc1653cffc16fc50a
MD5 1501dfa67439b88a14027ae9108ea04a
BLAKE2b-256 921b1cf7e8b429f8a48a87ec37577d2df97fa12cff8969d8087b2bfc2d07d217

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page