Skip to main content

OCloud

CI Python License

OCloud is a lightweight, synchronous Python library for managing selected AWS, Azure, and Google Cloud resources through their official CLI tools. It provides a typed provider API, a deliberately narrow unified API, structured command results, and an advanced provider-only raw CLI escape hatch.

What OCloud does

  • Runs only the official aws, az, and gcloud executables—no cloud SDK dependency or credential store.
  • Safely invokes subprocesses with argument lists; it never uses shell=True.
  • Captures redacted stdout, stderr, exit code, parsed JSON where applicable, and redacted command metadata.
  • Provides storage, compute, and serverless lifecycle helpers for the documented MVP surface.

Install and authenticate

python -m pip install ocloud
aws configure       # AWS users
az login            # Azure users
gcloud auth login   # Google Cloud users

Install the provider CLI separately; OCloud does not install it. Python 3.10–3.13 is supported.

Quick start

from ocloud import AWS

aws = AWS()
aws.auth.check_status()
result = aws.s3.put_object_acl(
    bucket="my-bucket",
    key="path/to/file.pdf",
    acl="public-read",
)

if result.success:
    print(result.data)
else:
    print(result.stderr)

Unified API

Use Cloud for operations with genuinely shared semantics. Provider-specific context remains explicit.

from ocloud import Cloud

cloud = Cloud("aws")
result = cloud.storage.upload(
    file="document.pdf",
    bucket="my-bucket",
    key="documents/document.pdf",
    timeout=60,
)

Provider APIs

Provider Storage Compute Serverless
AWS S3 upload/download/delete/list/exists/ACL EC2 start/stop/restart/status Lambda deploy/invoke/status/delete
Azure Blob upload/download/delete/list/exists VM start/stop/restart/status Function App ZIP deploy; Function status/delete
GCP Cloud Storage upload/download/delete/list/exists Compute Engine start/stop/restart/status Cloud Functions deploy/invoke/status/delete

Azure Functions has no generic Azure CLI invocation command. OCloud explicitly raises UnsupportedOperationError for that operation rather than misrepresenting a metadata request as an invocation.

Advanced raw CLI API

Use this only for provider operations not exposed by the MVP. It accepts arguments, not a shell string.

from ocloud import AWS

result = AWS().raw(
    "s3api", "put-object-acl", "--bucket", "my-bucket",
    "--key", "path/to/file.pdf", "--acl", "public-read",
)

Results and errors

Every executed operation returns CommandResult with success, returncode, redacted stdout, redacted stderr, data, command, provider, and operation. The package raises OCloud-specific exceptions for unavailable CLIs, authentication checks, invalid parameters, unsupported operations, and timeouts.

from ocloud import AWS, CLINotFoundError, OCloudTimeoutError

try:
    result = AWS().s3.list("my-bucket", timeout=30)
except CLINotFoundError:
    print("Install AWS CLI and ensure it is on PATH.")
except OCloudTimeoutError:
    print("The provider command exceeded its timeout.")

Security

Authentication stays in the official cloud CLI. OCloud has no credential database and redacts common secret patterns from command metadata and diagnostics. Use least-privilege cloud identities; avoid secrets in raw arguments. See SECURITY.md and docs/security.md.

Development

python -m pip install -e ".[dev]"
pre-commit install
ruff format --check .
ruff check .
mypy src/ocloud
pytest --cov=ocloud --cov-report=term-missing
python -m build

Unit tests use mocks and need no cloud account. The opt-in integration suite verifies only selected provider CLI authentication and performs no resource mutation; see Testing.

Documentation

Project status and roadmap

0.1.0 is an alpha API. The repository has mocked unit coverage and successful package validation. AWS, Azure, and GCP CLI authentication were manually verified through OCloud on a Windows host; GCP validation used its SDK bin directory on PATH for the validation process. No cloud-resource integration validation has been performed. Planned work includes opt-in integration environments, stronger provider error classification, more services, native SDK adapters, and async execution.

OCloud is released under the MIT License. See CHANGELOG.md for release history.

Metadata

Release files for ocloud 0.1.0

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

Source distribution (sdist)

Source distribution for ocloud 0.1.0
File Size Uploaded
ocloud-0.1.0.tar.gz 41.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ocloud 0.1.0
File Interpreter ABI Platform
ocloud-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 84.0 kB

Release files / ocloud-0.1.0.tar.gz

Download URL ocloud-0.1.0.tar.gz
Size 41.4 kB
Tags Source
SHA-256 checksum
How to use checksums
7c0bd61bdf98a6276883b8955b9b35d146d254e0e252f2cb25195527b7553a8e
BLAKE2b-256 checksum
How to use checksums
1876327233cfcfdb12970b2dab85f09242c05fb04a258e6f29ae1495470d0133
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 22, 2026.

Transparency log

Release files / ocloud-0.1.0-py3-none-any.whl

Download URL ocloud-0.1.0-py3-none-any.whl
Size 42.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4281e4230408b430f3c962b84715e15d8ab10f9156b46daa3a3a64ac9b95dfd3
BLAKE2b-256 checksum
How to use checksums
a6aaec528d0b759e8b4eda2d556b706422247b448e33764679d8046e3ed64bab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 22, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

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