Skip to main content

Synology Drive Web API integration for wcpan.drive

Project description

wcpan.drive.synology

Synology Drive Web API integration for wcpan.drive framework.

Features

  • Async file operations (upload, download, move, delete)
  • Session-based authentication with Synology DSM
  • SQLite-based local cache for offline operations
  • Media metadata support (images, videos)
  • Automatic retry and rate limiting

Installation

pip install wcpan-drive-synology

Usage

from wcpan.drive.synology import create_file_service, create_snapshot_service

# Create file service (remote API)
async with create_file_service(
    username="your_username",
    password="your_password",
    base_url="https://your-nas-url:5001",
) as file_service:
    root = await file_service.get_root()
    print(f"Root: {root}")

# Create snapshot service (local cache)
async with create_snapshot_service("./cache.db") as snapshot:
    root = await snapshot.get_root()
    print(f"Cached root: {root}")

Requirements

  • Python >= 3.13
  • aiohttp >= 3.13.0
  • wcpan-drive-core >= 4.1.0

Architecture Highlights

GIL-Free Database Operations

Following the wcpan.drive.sqlite pattern, this package uses ProcessPoolExecutor (not ThreadPoolExecutor) for all SQLite operations. This completely avoids Python's GIL and provides true parallelism for database operations.

# Database operations run in separate processes
async with create_snapshot_service("./cache.db") as snapshot:
    # This runs in a separate process - no GIL contention!
    root = await snapshot.get_root()

Other Features

  • Session-based authentication: Username/password login with optional 2FA
  • Streaming downloads: Range request support for efficient seeking
  • Buffered uploads: Memory-efficient file uploads
  • Automatic retry: Exponential backoff for rate limiting and transient errors
  • Type-safe: Full type hints with py.typed marker

License

MIT

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

wcpan_drive_synology-2.0.0a8.tar.gz (98.8 kB view details)

Uploaded Source

Built Distribution

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

wcpan_drive_synology-2.0.0a8-py3-none-any.whl (45.4 kB view details)

Uploaded Python 3

File details

Details for the file wcpan_drive_synology-2.0.0a8.tar.gz.

File metadata

  • Download URL: wcpan_drive_synology-2.0.0a8.tar.gz
  • Upload date:
  • Size: 98.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for wcpan_drive_synology-2.0.0a8.tar.gz
Algorithm Hash digest
SHA256 4f46a1529f133a9d1c84591c5cb919b4bea80a3c7a06ef8e140e79d6ab0ef02f
MD5 7fb972ed98cb7413dca54a52033f9277
BLAKE2b-256 1ffdc90f6575e7f62ca683ea995025d26e25f29d0edfaff88d1a1fc1da6d8a4f

See more details on using hashes here.

File details

Details for the file wcpan_drive_synology-2.0.0a8-py3-none-any.whl.

File metadata

  • Download URL: wcpan_drive_synology-2.0.0a8-py3-none-any.whl
  • Upload date:
  • Size: 45.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for wcpan_drive_synology-2.0.0a8-py3-none-any.whl
Algorithm Hash digest
SHA256 aca0e82a5cd90368abb834e409679877a0ae4ffda0367d62af170e9205cf0360
MD5 3df1fea066a9fce6ba3efff658956d6a
BLAKE2b-256 4bbd6b4c4e35e530a062b4bc8cf56e92c56858a297d06bbbd993b4e2819a787b

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