Skip to main content

Python SDK for AgentDisk API (gateway mode)

Project description

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)
client = AgentDiskClient(base_url="http://localhost:9100", token="<jwt>")

# API Key (from admin panel)
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 & preview
share = client.create_share("docs/reports", expire_hours=24)
result = client.preview("docs/reports/summary.md")

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

# Public directory
pub_dirs = client.list_public_directories()
pub_folders = client.list_public_directory_folders("shared-project")
pub_files = client.list_public_directory_files("shared-project/docs")

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")

API Overview

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

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
Preview preview
Space get_space
Public Directory list_public_directories, get_public_directory, list_public_directory_folders, list_public_directory_files
Cache invalidate_cache, clear_cache

License

Apache-2.0

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

agentdisk-0.2.0.tar.gz (42.3 kB view details)

Uploaded Source

Built Distribution

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

agentdisk-0.2.0-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file agentdisk-0.2.0.tar.gz.

File metadata

  • Download URL: agentdisk-0.2.0.tar.gz
  • Upload date:
  • Size: 42.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for agentdisk-0.2.0.tar.gz
Algorithm Hash digest
SHA256 fd6ab96a35a52cd3007aac270a13c88dfe8641183800bbcaab6a3efca5cf012d
MD5 315fb18f33ab21d24d062eb645dda05a
BLAKE2b-256 074b0f4b155e0e2e9255a52a8ba710a72ad4a340a747e75fbfc4351e49a192a1

See more details on using hashes here.

File details

Details for the file agentdisk-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: agentdisk-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 6.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for agentdisk-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bc108d53285bfbf270a14ec5b67c0ec9c3c08a96c93af85eec050a0f241284f6
MD5 b547425504da794aaf0a88813bcf2aa6
BLAKE2b-256 057a8d731cf72bd2154de7beb2fe7bf4446fd5e920b213380d8db873f557b2b5

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