Download files (Python SDK V2)

更新时间:
复制 MD 格式

Python SDK V2 provides several download methods. Choose one based on your use case.

Type

Interface name

Description

Simple download

client.get_object

  • Streaming download. Response body is StreamBody type.

  • No direct CRC-64 support

  • No direct progress bar support

  • No reconnection during streaming reads

client.get_object_to_file

  • Downloads to local files

  • Single-connection download

  • CRC-64 supported (enabled by default)

  • Progress bar supported

  • Reconnection on failure

Range download

client.get_object

  • Downloads a specific range of data

Read-only class file

ReadOnlyFile

ReadOnlyFile.read

ReadOnlyFile.seek

ReadOnlyFile.close

  • File-like interface with read, seek, and close methods

  • Supports seek

  • Single-stream mode (default)

  • Asynchronous prefetch for faster reads

  • Configurable block size and prefetch chunk count

  • No direct CRC-64 support

  • No direct progress bar support

  • Reconnection on failure

Download using presigned URL

client.presign

  • Generates a time-limited presigned URL for downloading objects via HTTP GET

File download manager

Downloader.download_file

  • Multipart download to local files

  • Configurable part size and parallelism

  • CRC-64 supported (enabled by default)

  • Progress bar supported

  • Reconnection on failure

  • Resumable transfers

  • Writes to a temp file, then renames (configurable, enabled by default)