Skip to main content

codecraftai-restclient-digitalocean

A pure-Python client for the DigitalOcean API v2 and for Spaces, its S3-compatible object store.

Two clients live here because DigitalOcean has two authentication systems: the API is a Bearer personal access token, while Spaces has its own S3-style access-key pair and SigV4 signing. A token carries no authority in Spaces and a Spaces key carries none in the API.

The API client

The api groups are named to match the surface the pydo SDK presented, and every response is a plain dict:

from ccai.restclient.digitalocean.digitaloceanrestclient import (
    DigitalOceanRestClient
)

client = DigitalOceanRestClient(token=token)

created = client.droplets.create(body={"name": "srv-a", ...})
droplet = created.get("droplet", {})

page = client.droplets.list(per_page=200, page=1, tag_name="run:abc")
for entry in page.get("droplets", []):
    ...

client.droplets.destroy(droplet_id=droplet["id"])

Groups: vpcs, firewalls, droplets, volumes, volume_actions, ssh_keys, domains.

list returns ONE page, exactly as the SDK did, so paging stays visible to the caller rather than hidden in the transport. Follow links.pages.next to exhaust a collection.

The Spaces client

from ccai.restclient.digitalocean.spacesclient import SpacesClient

spaces = SpacesClient(access_key=key, secret_key=secret, region="nyc3")

spaces.create_bucket(Bucket="my-bucket")
spaces.head_bucket(Bucket="my-bucket")
spaces.delete_bucket(Bucket="my-bucket")

The method and keyword names mirror the S3 surface — including the capitalised Bucket — so call sites written against an S3 SDK keep their shape. Signing comes from ccai.restclient.base.awssigv4, shared with AWS and any other S3-compatible store.

Design notes

Requests are path-style. A bucket created moments ago is immediately addressable at https://{region}.digitaloceanspaces.com/{bucket}, while its virtual-host name has to wait on DNS. An apply that creates a bucket and then heads it would intermittently fail under virtual-host addressing.

Spaces errors carry the S3 code as an attribute. SpacesRequestError exposes status, code and body. Callers distinguish “bucket absent” (recover) from “auth or throttle failed” (do not recover) on that code, so it is first-class rather than something to dig out of a message. A failed HEAD has no body at all, so the status is used as the code in that case — it must never come back empty for a 404.

Error XML is matched on local names. S3 responses are namespaced, and whether an endpoint declares the namespace varies, so tags are matched with the namespace stripped.

Errors are thin. Translating status codes into a typed hierarchy is the consumer’s policy, not the transport’s.

Metadata

Release files for codecraftai-restclient-digitalocean 1.2.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 codecraftai-restclient-digitalocean 1.2.0
File Size Uploaded Provenance
codecraftai_restclient_digitalocean-1.2.0.tar.gz 17.3 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for codecraftai-restclient-digitalocean 1.2.0
File Interpreter ABI Platform
codecraftai_restclient_digitalocean-1.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 41.4 kB

Release files / codecraftai_restclient_digitalocean-1.2.0.tar.gz

Download URL codecraftai_restclient_digitalocean-1.2.0.tar.gz
Size 17.3 kB
Tags Source
SHA-256 checksum
How to use checksums
457c9577cefea4be6e27e7c43c70e5afac7b6ec861443051eb452520dc7f63df
BLAKE2b-256 checksum
How to use checksums
29ec196a7ea0e7c384addc78cd8b06cfdfa5b7d4f9f1fcbb6c256f2f3d627017
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 Oct 19, 2026.

Transparency log

Release files / codecraftai_restclient_digitalocean-1.2.0-py3-none-any.whl

Download URL codecraftai_restclient_digitalocean-1.2.0-py3-none-any.whl
Size 24.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dc54759d1f082e7bb17eba334738673eacfd4ee242ce0730c7c4524c2978c1da
BLAKE2b-256 checksum
How to use checksums
5c5ad4579ae0cb3fdf9d08449b8e957d2342c2a0cadea97b3d4ccceb1acbc125
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 Oct 19, 2026.

Transparency log

Security for codecraftai-restclient-digitalocean 1.2.0

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 codecraftai_restclient_digitalocean-1.2.0.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 19, 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

1.2.0 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