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.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| codecraftai_restclient_digitalocean-1.2.1.tar.gz | 17.1 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| codecraftai_restclient_digitalocean-1.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 41.2 kB
Release files / codecraftai_restclient_digitalocean-1.2.1.tar.gz
| Download URL | codecraftai_restclient_digitalocean-1.2.1.tar.gz |
|---|---|
| Size | 17.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6451c78c02772b2593b5c7ba50abe9bfbd729130d3b51f12f549af11904c8801
|
|
BLAKE2b-256 checksum How to use checksums |
a652b7c6044887945eb61f6b2e3dbfe83ddb950d54e784cd53c8650e6c20e44f
|
| 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 20, 2026.
Transparency logRelease files / codecraftai_restclient_digitalocean-1.2.1-py3-none-any.whl
| Download URL | codecraftai_restclient_digitalocean-1.2.1-py3-none-any.whl |
|---|---|
| Size | 24.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0c929b67d614e8a80fe1f560ca8c01447f73b06d0f1abb8406082bf2814a922a
|
|
BLAKE2b-256 checksum How to use checksums |
5671d96299c30b7ed22fdc879ec1da82f9d753200015a1e5f4bc7b6d51416f90
|
| 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 20, 2026.
Transparency logSecurity for codecraftai-restclient-digitalocean 1.2.1
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.
Attestation for codecraftai_restclient_digitalocean-1.2.1.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 20, 2026.
Transparency logA 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.