Skip to main content

HomeCloud SDK

Polyglot SDK for HomeCloud — Python at the repo root (pip install homecloud-sdk), Node.js under js/ (@homecloud-platform/sdk), Go under go/ (github.com/HomeCloudLab/homecloud-sdk/go), Java under java/ (com.homecloudlab:homecloud-sdk).

Parity goal: same HomeCloud capabilities on the same semver. Track gaps in js/PARITY.md. Go follows ADR-051 and Java follows ADR-052: idiomatic public API, behavioral parity, no bug-parity for unsafe retries.

Auth model (cloud-style)

Who How MFA
SDK / automation Access Key ID + Secret (SigV1 data plane) Never on requests
CLI / humans homecloud login → console JWT At login / step-up only

Access Keys are created once in the Console (human + MFA there). Runtime SDK calls do not re-prompt MFA.

from homecloud import HomeCloud

# Recommended — explicit credentials (CI / servers)
client = HomeCloud(
    access_key="HCAK...",
    secret_key="...",
)

# Or environment (HOMECLOUD_* / HC_*)
client = HomeCloud.from_env()

# Or ~/.homecloud/credentials (+ optional HC_PROFILE)
client = HomeCloud()

# Data plane — Access Key only, no login
client.so.upload("docs", "./file.txt", key="a.txt")
client.so.upload(
    "media",
    body=video_bytes,
    key="videos/clip.mp4",
    content_type="video/mp4",
)
client.mq.send("orders", {"id": 1})
client.mq.send("orders", [{"id": 1}, {"id": 2}])  # batch (1–10)

# Interactive helpers only (CLI/tools) — may involve MFA
# client.login("100200300400", "alice", "…")  # account number or alias, then username/password
# client.login_browser()

Node.js (@homecloud-platform/sdk)

const { HomeCloud } = require("@homecloud-platform/sdk");

const client = HomeCloud.fromSts(context.sts.archive, {
  accountId: context.account_id,
});
await client.so.putJson("docs", "a.json", { ok: true });

See js/README.md. Same STS / mailapi rewrite rules as Python ≥0.4.9.

Go (github.com/HomeCloudLab/homecloud-sdk/go)

client, err := homecloud.FromEnv()
_, err = client.SO.PutJSON(ctx, "docs", "a.json", map[string]any{"ok": true})

See go/README.md. Release tags: v* (PyPI/npm/Java) and go/v* (Go module).

Java (com.homecloudlab:homecloud-sdk)

HomeCloud client = HomeCloud.fromEnv();
client.so().putJson("docs", "a.json", Map.of("ok", true));

See java/README.md. Requires Java 17. First publish: GitHub Packages; Maven Central is the public GA gate.

Async

from homecloud import AsyncHomeCloud

async with AsyncHomeCloud.from_env() as client:
    meta = await client.so.head_object("docs", "a.txt")
    await client.mq.send("orders", {"id": 1})
    await client.mq.receive("orders", max_messages=10, delete=True)

from homecloud_sdk import … still works (compatibility). Prefer from homecloud import ….

Errors

HTTP failures raise typed subclasses of HomeCloudError (catch specific types or the base):

Type Typical status
NotFoundError 404 (bucket / object / queue)
UnauthorizedError 401
PermissionDeniedError 403
BadRequestError 400
ConflictError 409
RateLimitError 429
ServiceUnavailableError 502–504
ApiError other HTTP errors
from homecloud import HomeCloud, NotFoundError, HomeCloudError

client = HomeCloud()
try:
    client.so.head_object("docs", "a.txt")
except NotFoundError as exc:
    print(exc.resource_type, exc.resource, exc)  # object / docs/a.txt / …
except HomeCloudError as exc:
    print(exc.status_code, exc)

Architecture

homecloud/          ← preferred public import (Python)
homecloud_core/     ← auth, routing, signing, sessions, MFA helpers
homecloud_sdk/      ← HomeCloud + AsyncHomeCloud
js/                 ← @homecloud-platform/sdk (Node.js 20+)
go/                 ← github.com/HomeCloudLab/homecloud-sdk/go (Go 1.22+)
java/               ← com.homecloudlab:homecloud-sdk (Java 17+)
testdata/contracts/ ← shared SigV1 + error fixtures

CLI (homecloud-cli) is a Typer/Rich wrapper; it opts into interactive_mfa=True on the sync client.

Install

pip install homecloud-sdk

Until PyPI is configured, use a Git checkout or sibling editable install:

pip install -e "../homecloud-sdk"

PyPI publish is wired via .github/workflows/publish-pypi.yml (tag v* + Trusted Publishing). npm publish is wired via .github/workflows/publish-npm.yml (same v* tag → aligned versions).

./scripts/bump-version.sh 0.5.0
# commit, push, then:
git tag v0.5.0 && git push origin v0.5.0

Operations by plane

API Auth Notes
so.upload / download / sync_* / list_objects / delete Access Key Primary SDK path
so.head_object (object_metadata) Access Key Metadata only — no object body (AWS HeadObject)
so.get_object_uri Access Key so:// + public HTTPS URL
so.generate_presigned_url Access Key Time-limited GET URL
mq.send / receive / delete / purge / DLQ Access Key receive(delete=True) fast ack; batch send via list
queues.list / queues.get Console JWT list(live=True) for depth/inflight/DLQ
account_id() Access Key whoami No JWT
so.list_buckets / create_bucket Console JWT Management helper
queues.list / apps.list / accounts.* Console JWT Management helper

Async mirrors the same surface on AsyncHomeCloud (await client.so.…).

Configuration

File Purpose
~/.homecloud/credentials Access Keys (multi-profile JSON)
~/.homecloud/session Console JWT (interactive only)

Profile / env

  1. Constructor profile= / access_key_id= …
  2. HOMECLOUD_PROFILE / HC_PROFILE
  3. credentials default_profile
  4. default
Variable Short Effect
HOMECLOUD_PROFILE HC_PROFILE Active profile
HOMECLOUD_ACCESS_KEY_ID HC_ACCESS_KEY_ID Access key
HOMECLOUD_SECRET_ACCESS_KEY HC_SECRET_ACCESS_KEY Secret
HOMECLOUD_ACCOUNT_ID HC_ACCOUNT_ID Optional account
HOMECLOUD_APEX HC_APEX Platform domain

Development

pip install -e ".[dev]"
pytest tests/ -q
pytest tests/test_live_integration.py -q   # needs Access Keys in ~/.homecloud

cd js && npm test
cd go && go test ./...
cd java && mvn test

Service-account verification (pre-PyPI)

Mints a dedicated Access Key named homecloud-sdk-test (requires a one-time homecloud login to create the key), then runs a clean subprocess with HomeCloud.from_env() — no JWT session, no MFA, no browser:

python scripts/verify_service_account_flow.py

Expected: PASS: service-account flow works without login/JWT/MFA/browser.

Metadata

Release files for homecloud-sdk 0.5.18

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

Source distribution (sdist)

Source distribution for homecloud-sdk 0.5.18
File Size Uploaded Provenance
homecloud_sdk-0.5.18.tar.gz 69.1 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for homecloud-sdk 0.5.18
File Interpreter ABI Platform
homecloud_sdk-0.5.18-py3-none-any.whl Python 3 none any Details

Total release size: 128.4 kB

Release files / homecloud_sdk-0.5.18.tar.gz

Download URL homecloud_sdk-0.5.18.tar.gz
Size 69.1 kB
Tags Source
SHA-256 checksum
How to use checksums
13367cb7a8bb7b93db046548b41864238989988d32cab61b5e4f3d784e26a053
BLAKE2b-256 checksum
How to use checksums
db8f746cc1c1322f8e3005b6d8a1316713fd739e0ac353f6ba7a669e34f1cd34
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 Sep 18, 2026.

Transparency log

Release files / homecloud_sdk-0.5.18-py3-none-any.whl

Download URL homecloud_sdk-0.5.18-py3-none-any.whl
Size 59.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5502f749f0f22297b043cb7c8713fa913b9abaae0fda3abc343a0445e221407d
BLAKE2b-256 checksum
How to use checksums
de63386eb0ff99b0e6565451f20c60a21502dce53f5b12a73f1db1b8da620880
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 Sep 18, 2026.

Transparency log

Security for homecloud-sdk 0.5.18

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

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for homecloud_sdk-0.5.18.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 Sep 18, 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.

Release history Release notifications | RSS feed

This release

0.5.18 This release

2 release files Full provenance

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