Skip to main content

Driftstone - Python

Python SDK for the Driftstone repository API.

Install

pip install driftstone

Quick Start

from driftstone import Driftstone

client = Driftstone(api_key="your-api-key")

repo = client.repos.create(
    "hello-world",
)

upload = client.repos.create_upload(
    "hello-world",
    storage_dir="ver-1234abcd",
    branch="main",
    files=[{"name": "README.md", "hash": "64-character-sha256-or-client-hash"}],
)

# Upload each file to the returned signed URL with PUT and
# Content-Type: application/octet-stream.
for upload_url in upload.upload_urls:
    print(upload_url.name, upload_url.url)

client.repos.complete_upload("hello-world", upload.upload_id)

download = client.repos.create_download(
    "hello-world",
    type="main",
    files=[{"path": "ver-1234abcd/README.md"}],
)

for download_url in download.download_urls:
    print(download_url.path, download_url.url)

branch = client.repos.create_branch(
    "hello-world",
    "feature-readme",
    storage_dir="state-123",
    transforms={"README.md": "# Example Repo\nUpdated content.\n"},
)

empty_branch = client.repos.create_branch(
    "hello-world",
    "empty-feature",
    derive_from_main=False,
)

branch_upload = client.repos.create_upload(
    "hello-world",
    storage_dir="state-456",
    branch=branch.name,
    files=[{"name": "README.md", "hash": "64-character-sha256-or-client-hash"}],
)
client.repos.complete_upload("hello-world", branch_upload.upload_id)

print(repo.id, branch.name)

Extensions

extension = client.extensions.create(
    name="README reviewer",
    prompt="Inspect README changes and suggest concise release-note updates.",
    presets=["openclaw"],
)

run = client.extensions.run(
    extension.id,
    path="organizations/org-.../repositories/hello-world/main/ver-1234abcd",
    prompt="Focus on docs/README.md.",
)

status = client.extensions.poll(run.run_id)
print(status.status, status.result)

Using A Context Manager

from driftstone import Driftstone

with Driftstone(api_key="your-api-key") as client:
    repo = client.repos.get("hello-world")
    branches = client.repos.list_branches(repo.slug)

    print(repo.name, [branch.name for branch in branches])

Metadata

Release files for driftstone 1.3.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 driftstone 1.3.0
File Size Uploaded Provenance
driftstone-1.3.0.tar.gz 10.1 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 24.7 kB

Release files / driftstone-1.3.0.tar.gz

Download URL driftstone-1.3.0.tar.gz
Size 10.1 kB
Tags Source
SHA-256 checksum
How to use checksums
a6a82d4fb69fdea4ccb115bbd994393b28afa623513eb611a2055a6199974c98
BLAKE2b-256 checksum
How to use checksums
b0428c2d3f51db3c440fc8704b215724be34e9a9002ff16078372c9511dda7fe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.6

Release files / driftstone-1.3.0-py3-none-any.whl

Download URL driftstone-1.3.0-py3-none-any.whl
Size 14.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fe06aa8fd3da15c796b35dfeaf13a0cdef3a3001cdfc50dc5a34563525078945
BLAKE2b-256 checksum
How to use checksums
c864f31badda315801e61324906a2004e544ed1a4514fbbbfb42e1bbe3f0d861
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.6

Security for driftstone 1.3.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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