Skip to main content

Python SDK for Trove — managed POSIX filesystem for AI agents

Project description

trove-sdk · Python

Python client for Trove — managed POSIX filesystem for AI agents.

Installation

pip install trove-sdk
# or
uv add trove-sdk

Requires Python 3.10+.

Usage

Filesystem operations

from trove_sdk import TroveClient

with TroveClient(api_key="trove-sk-...", namespace="alice") as client:
    # Run shell commands
    client.exec("mkdir -p workspace/data")
    output = client.exec("ls workspace/")

    # Write a text file
    client.write("workspace/data/notes.txt", "hello world")

    # Upload binary
    with open("image.png", "rb") as f:
        client.upload("workspace/data/image.png", f)

    # Delete
    client.delete("workspace/data/notes.txt")

Async

from trove_sdk import AsyncTroveClient

async with AsyncTroveClient(api_key="trove-sk-...", namespace="alice") as client:
    await client.exec("echo hello")
    await client.write("workspace/hello.txt", "hi")

Key management (multi-tenant)

Use an admin key from the dashboard to mint scoped keys per customer:

from trove_sdk import TroveAdminClient

with TroveAdminClient(api_key="trove-sk-admin-...", workspace_id="ws-...") as admin:
    # Mint a scoped key for a customer
    key = admin.create_key("customer-alice", namespace="alice")
    print(key.api_key)  # store this — shown once

    # List active keys
    keys = admin.list_keys()

    # Revoke
    admin.revoke_key(key.key_id)

API reference

TroveClient(api_key, namespace, *, base_url?)

Method Description
exec(command) Run a shell command. Returns stdout as a string.
write(path, content) Write a UTF-8 text file. Returns FileResult.
upload(path, data) Upload bytes or a file-like object. Returns FileResult.
delete(path) Delete a file or directory. Returns the deleted path.

AsyncTroveClient mirrors the same interface with async/await.

TroveAdminClient(api_key, workspace_id, *, base_url?)

Method Description
create_key(name, *, namespace?) Mint a new workspace key, optionally scoped to a namespace.
list_keys() List all active keys for the workspace.
revoke_key(key_id) Revoke a key immediately.

AsyncTroveAdminClient mirrors the same interface with async/await.

Errors

All errors raise TroveError(message, status_code).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

trove_sdk-0.1.2.tar.gz (14.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

trove_sdk-0.1.2-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file trove_sdk-0.1.2.tar.gz.

File metadata

  • Download URL: trove_sdk-0.1.2.tar.gz
  • Upload date:
  • Size: 14.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.16 {"installer":{"name":"uv","version":"0.9.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for trove_sdk-0.1.2.tar.gz
Algorithm Hash digest
SHA256 b8946a005756c39d2586534b0c04040c94e358f95eda593d8114fd6369bba3f5
MD5 d27374b51dd0ef2175de53b6576d852b
BLAKE2b-256 bc473f00e49df2bf74d7279b8d4afd8e3b55a178a06468b164f8fbe7a4738295

See more details on using hashes here.

File details

Details for the file trove_sdk-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: trove_sdk-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.16 {"installer":{"name":"uv","version":"0.9.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for trove_sdk-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e7787c9a62932f9be7acd81093f4060fefeb4baf9dce1e88b1fe829cd2de1718
MD5 99bbcd7011ecd126df2404d46463bb7e
BLAKE2b-256 2ce1c233bcb8607bfdcdff499044f24cdb5993a7cb68c06dc160756e90cef391

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page