Skip to main content

AgentDisk Python SDK

Python SDK for AgentDisk — an enterprise-grade cloud disk middleware designed for multi-agent systems.

Installation

pip install agentdisk

Requires Python 3.9+.

Quick Start

Authentication

The SDK supports two authentication methods — JWT token or API Key:

# JWT token (from gateway auth) — full private resource access + public directory read-only
client = AgentDiskClient(base_url="http://localhost:9100", token="<jwt>")

# API Key (from admin panel) — public directory CRUD only, no private access
client = AgentDiskClient(base_url="http://localhost:9100", api_key="<api-key>")

Synchronous Client

from agentdisk import AgentDiskClient

client = AgentDiskClient(
    base_url="http://localhost:9100",
    token="<jwt-from-gateway>",
)

# Folder operations
client.create_folder("docs/reports")
folders = client.list_folders("docs")
ancestors = client.get_folder_ancestors("docs/reports")

# File operations
client.upload_file("docs/reports/summary.md", "/local/summary.md")
client.upload_bytes("docs/notes.txt", b"hello world", auto_mkdir=True)
files = client.list_files("docs/reports")

# File download
result = client.download_file("docs/reports/summary.md")
client.download_file_to("docs/reports/summary.md", "/local/summary.md")

# Share
share = client.create_share("docs/reports", expire_hours=24)

# Download shared file
client.download_shared_file(code="AbC123", resource_id=42)

# Public directory — access by display_name as path
pub_dirs = client.list_public_directories()
client.list_files("shared-project")                   # list files
client.download_file("shared-project/data.csv")       # download
client.create_share("shared-project/data.csv", is_file=True)  # share

client.close()

Asynchronous Client

from agentdisk import AsyncAgentDiskClient

async with AsyncAgentDiskClient(
    base_url="http://localhost:9100",
    token="<jwt-from-gateway>",
) as client:
    await client.create_folder("docs/reports")
    await client.upload_file("docs/reports/summary.md", "/local/summary.md")
    files = await client.list_files("docs/reports")

    # Download
    result = await client.download_file("docs/reports/summary.md")
    await client.download_file_to("docs/reports/summary.md", "/local/summary.md")

Admin Client (API Key only)

from agentdisk import AgentDiskAdminClient

admin = AgentDiskAdminClient(
    base_url="http://localhost:9100",
    api_key="<api-key>",
)

# Grant user access to a public directory
admin.grant_access(public_dir_id=1, user_id="user-123")
users = admin.list_granted_users(public_dir_id=1)

# Revoke access
admin.revoke_access(public_dir_id=1, user_id="user-123")
admin.close()

Authentication Matrix

Operation JWT Token API Key
Private files/folders CRUD Full access Blocked
Public directory list/browse Granted users Full access
Public directory download/share Granted users Blocked
Public directory upload/delete/create folder Blocked Full access
User authorization management Blocked Full access

API Overview

All operations use path-based API — no need to manage folder/file IDs manually.

Public directories are accessed by their display_name as a path segment:

# Private resource
client.upload_file("docs/report.txt", "/local/report.txt")

# Public directory (display_name = "shared-project")
client.list_files("shared-project")
client.download_file("shared-project/data.csv")
Category Methods
Folders create_folder, list_folders, get_folder, rename_folder, delete_folder, get_folder_ancestors
Files upload_file, upload_bytes, list_files, get_file, update_file, update_file_bytes, delete_file, download_file, download_file_to
Shares create_share, list_shares, revoke_share, get_share_by_code, access_share, download_shared_file
Permissions grant_permission, list_permissions, check_permission, revoke_permission
Tags bind_tag, unbind_tag, search_files
Versions list_versions, rollback_version
Recycle Bin list_recycle, restore, delete_permanent
Space get_space
Public Directory list_public_directories
Cache invalidate_cache, clear_cache

License

Apache-2.0

Metadata

Release files for agentdisk 0.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 agentdisk 0.3.0
File Size Uploaded Provenance Actions
agentdisk-0.3.0.tar.gz 55.2 kB Without provenance Details for agentdisk-0.3.0.tar.gz

Built distribution (wheel)

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

Total release size: 84.7 kB

Release files / agentdisk-0.3.0.tar.gz

Download URL agentdisk-0.3.0.tar.gz
Size 55.2 kB
Tags Source
SHA-256 checksum
How to use checksums
6d5f6a3f31897c59d4b0166993393ec72aac02a092f797f31d27c39f75e60d1f
BLAKE2b-256 checksum
How to use checksums
a8e5e627977333b4401e74ff7e45cbd23aec730b24bd315c7c31f007af561555
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.10

Release files / agentdisk-0.3.0-py3-none-any.whl

Download URL agentdisk-0.3.0-py3-none-any.whl
Size 29.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f93952503c45a1faafd628ec611907a1639cda2495931113352b937a26b138f8
BLAKE2b-256 checksum
How to use checksums
bf73956be141f7402a997c366443145052793bbd7519c1c5c059301759f8d311
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.10

Security for agentdisk 0.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