Skip to content

Commit f083072

Browse files
committed
update document comments
1 parent e0d1849 commit f083072

File tree

2 files changed

+36
-4
lines changed

2 files changed

+36
-4
lines changed

alibabacloud_oss_v2/downloader.py

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,14 @@ def __init__(
103103
) -> None:
104104
"""
105105
client (DownloadAPIClient): A agent that implements the HeadObject and GetObject api.
106-
downloader_options (DownloaderOptions, optional): optional.
106+
kwargs: Extra keyword arguments used to initialize the downloader.
107+
- part_size (int): The part size. Default value: 6 MiB.
108+
- parallel_num (int): The number of the download tasks in parallel. Default value: 3.
109+
- block_size (int): The block size is the number of bytes it should read into memory. Default value: 16 KiB.
110+
- use_temp_file (bool): Whether to use a temporary file when you download an object. A temporary file is used by default.
111+
- enable_checkpoint (bool): Whether to enable checkpoint. Defaults to False.
112+
- checkpoint_dir (str): The directory to store checkpoint.
113+
- verify_data (bool): Whether to verify data when the download is resumed. Defaults to False.
107114
"""
108115
part_size = kwargs.get('part_size', defaults.DEFAULT_DOWNLOAD_PART_SIZE)
109116
parallel_num = kwargs.get('parallel_num', defaults.DEFAULT_DOWNLOAD_PARALLEL)
@@ -138,7 +145,14 @@ def download_file(
138145
Args:
139146
request (models.GetObjectRequest): the request parameters for the download operation.
140147
filepath (str): The path of a local file.
141-
148+
kwargs: Extra keyword arguments.
149+
- part_size (int): The part size.
150+
- parallel_num (int): The number of the download tasks in parallel.
151+
- block_size (int): The block size is the number of bytes it should read into memory.
152+
- use_temp_file (bool): Whether to use a temporary file when you download an object.
153+
- enable_checkpoint (bool): Whether to enable checkpoint.
154+
- checkpoint_dir (str): The directory to store checkpoint.
155+
- verify_data (bool): Whether to verify data when the download is resumed.
142156
Returns:
143157
DownloadResult: The result for the download operation.
144158
"""
@@ -178,7 +192,10 @@ def download_to(
178192
Args:
179193
request (models.GetObjectRequest): the request parameters for the download operation.
180194
writer (IO[bytes]): writes the data into writer
181-
195+
kwargs: Extra keyword arguments.
196+
- part_size (int): The part size.
197+
- parallel_num (int): The number of the download tasks in parallel.
198+
- block_size (int): The block size is the number of bytes it should read into memory.
182199
Returns:
183200
DownloadResult: The result for the download operation.
184201
"""

alibabacloud_oss_v2/uploader.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,12 @@ def __init__(
151151
) -> None:
152152
"""
153153
client (UploadAPIClient): A agent that implements the PutObject and Multipart Upload api.
154+
kwargs: Extra keyword arguments used to initialize the uploader.
155+
- part_size (int): The part size. Default value: 6 MiB.
156+
- parallel_num (int): The number of the upload tasks in parallel. Default value: 3.
157+
- leave_parts_on_error (bool): Whether to retain the uploaded parts when an upload task fails. By default, the uploaded parts are not retained.
158+
- enable_checkpoint (bool): Whether to enable checkpoint. Defaults to False.
159+
- checkpoint_dir (str): The directory to store checkpoint.
154160
"""
155161
part_size = kwargs.get('part_size', defaults.DEFAULT_UPLOAD_PART_SIZE)
156162
parallel_num = kwargs.get('parallel_num', defaults.DEFAULT_UPLOAD_PARALLEL)
@@ -187,6 +193,12 @@ def upload_file(
187193
Args:
188194
request (models.PutObjectRequest): the request parameters for the upload operation.
189195
filepath (str): The path of a local file.
196+
kwargs: Extra keyword arguments.
197+
- part_size (int): The part size.
198+
- parallel_num (int): The number of the upload tasks in parallel.
199+
- leave_parts_on_error (bool): Whether to retain the uploaded parts when an upload task fails.
200+
- enable_checkpoint (bool): Whether to enable checkpoint.
201+
- checkpoint_dir (str): The directory to store checkpoint.
190202
191203
Returns:
192204
UploadResult: The result for the upload operation.
@@ -222,7 +234,10 @@ def upload_from(
222234
Args:
223235
request (models.PutObjectRequest): The request parameters for the upload operation.
224236
reader (IO[bytes]): The stream to be uploaded.
225-
237+
kwargs: Extra keyword arguments.
238+
- part_size (int): The part size.
239+
- parallel_num (int): The number of the upload tasks in parallel.
240+
- leave_parts_on_error (bool): Whether to retain the uploaded parts when an upload task fails.
226241
Returns:
227242
UploadResult: The result for the upload operation.
228243
"""

0 commit comments

Comments
 (0)