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.1.tar.gz (51.9 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.1-py3-none-any.whl (27.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: agentdisk-0.2.1.tar.gz
  • Upload date:
  • Size: 51.9 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.1.tar.gz
Algorithm Hash digest
SHA256 e4687e07e37c38c21ffe864dc06e47daaa147a41d641482f219f5c8389f1d447
MD5 b30990cd5b267f6aee9ddde524f03110
BLAKE2b-256 5a62b298a382fe50482e14a73e1486a311dc5155282e614b7a08f1da84aada12

See more details on using hashes here.

File details

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

File metadata

  • Download URL: agentdisk-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 27.3 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2ae9889327ac449b898f8157efc73e5c8c26162322cd85265505eb1a1dcddfc6
MD5 83804df7a0aa78be33a5a757d69889e8
BLAKE2b-256 3deeb521872f40c6612d85aec1473255ca1bcd115e06c3f2a0e96adfb05bec5e

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