azure-storage-blob 12.26.0b1__py3-none-any.whl → 12.27.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. azure/storage/blob/__init__.py +6 -5
  2. azure/storage/blob/_blob_client.py +59 -38
  3. azure/storage/blob/_blob_client.pyi +780 -0
  4. azure/storage/blob/_blob_client_helpers.py +4 -3
  5. azure/storage/blob/_blob_service_client.py +57 -17
  6. azure/storage/blob/_blob_service_client.pyi +182 -0
  7. azure/storage/blob/_container_client.py +47 -22
  8. azure/storage/blob/_container_client.pyi +380 -0
  9. azure/storage/blob/_deserialize.py +1 -1
  10. azure/storage/blob/_download.py +7 -7
  11. azure/storage/blob/_encryption.py +177 -184
  12. azure/storage/blob/_generated/_azure_blob_storage.py +3 -2
  13. azure/storage/blob/_generated/_configuration.py +2 -2
  14. azure/storage/blob/_generated/_utils/__init__.py +6 -0
  15. azure/storage/blob/_generated/{_serialization.py → _utils/serialization.py} +4 -22
  16. azure/storage/blob/_generated/aio/_azure_blob_storage.py +3 -2
  17. azure/storage/blob/_generated/aio/_configuration.py +2 -2
  18. azure/storage/blob/_generated/aio/operations/_append_blob_operations.py +6 -10
  19. azure/storage/blob/_generated/aio/operations/_blob_operations.py +35 -39
  20. azure/storage/blob/_generated/aio/operations/_block_blob_operations.py +9 -13
  21. azure/storage/blob/_generated/aio/operations/_container_operations.py +20 -24
  22. azure/storage/blob/_generated/aio/operations/_page_blob_operations.py +13 -17
  23. azure/storage/blob/_generated/aio/operations/_service_operations.py +10 -14
  24. azure/storage/blob/_generated/models/_models_py3.py +30 -9
  25. azure/storage/blob/_generated/operations/_append_blob_operations.py +11 -15
  26. azure/storage/blob/_generated/operations/_blob_operations.py +60 -64
  27. azure/storage/blob/_generated/operations/_block_blob_operations.py +16 -20
  28. azure/storage/blob/_generated/operations/_container_operations.py +39 -43
  29. azure/storage/blob/_generated/operations/_page_blob_operations.py +23 -27
  30. azure/storage/blob/_generated/operations/_service_operations.py +19 -23
  31. azure/storage/blob/_lease.py +3 -2
  32. azure/storage/blob/_lease.pyi +81 -0
  33. azure/storage/blob/_list_blobs_helper.py +1 -1
  34. azure/storage/blob/_quick_query_helper.py +3 -3
  35. azure/storage/blob/_serialize.py +1 -0
  36. azure/storage/blob/_shared/__init__.py +7 -7
  37. azure/storage/blob/_shared/authentication.py +49 -32
  38. azure/storage/blob/_shared/avro/avro_io.py +44 -42
  39. azure/storage/blob/_shared/avro/avro_io_async.py +42 -41
  40. azure/storage/blob/_shared/avro/datafile.py +24 -21
  41. azure/storage/blob/_shared/avro/datafile_async.py +15 -15
  42. azure/storage/blob/_shared/avro/schema.py +196 -217
  43. azure/storage/blob/_shared/base_client.py +79 -70
  44. azure/storage/blob/_shared/base_client_async.py +53 -68
  45. azure/storage/blob/_shared/constants.py +1 -1
  46. azure/storage/blob/_shared/models.py +94 -92
  47. azure/storage/blob/_shared/parser.py +3 -3
  48. azure/storage/blob/_shared/policies.py +186 -147
  49. azure/storage/blob/_shared/policies_async.py +58 -69
  50. azure/storage/blob/_shared/request_handlers.py +50 -45
  51. azure/storage/blob/_shared/response_handlers.py +54 -45
  52. azure/storage/blob/_shared/shared_access_signature.py +65 -73
  53. azure/storage/blob/_shared/uploads.py +56 -49
  54. azure/storage/blob/_shared/uploads_async.py +70 -58
  55. azure/storage/blob/_version.py +1 -1
  56. azure/storage/blob/aio/__init__.py +8 -10
  57. azure/storage/blob/aio/_blob_client_async.py +81 -48
  58. azure/storage/blob/aio/_blob_client_async.pyi +763 -0
  59. azure/storage/blob/aio/_blob_service_client_async.py +54 -15
  60. azure/storage/blob/aio/_blob_service_client_async.pyi +187 -0
  61. azure/storage/blob/aio/_container_client_async.py +55 -26
  62. azure/storage/blob/aio/_container_client_async.pyi +384 -0
  63. azure/storage/blob/aio/_download_async.py +15 -11
  64. azure/storage/blob/aio/_lease_async.py +3 -2
  65. azure/storage/blob/aio/_lease_async.pyi +81 -0
  66. azure/storage/blob/aio/_quick_query_helper_async.py +3 -3
  67. {azure_storage_blob-12.26.0b1.dist-info → azure_storage_blob-12.27.0.dist-info}/METADATA +18 -6
  68. azure_storage_blob-12.27.0.dist-info/RECORD +94 -0
  69. {azure_storage_blob-12.26.0b1.dist-info → azure_storage_blob-12.27.0.dist-info}/WHEEL +1 -1
  70. azure_storage_blob-12.26.0b1.dist-info/RECORD +0 -85
  71. {azure_storage_blob-12.26.0b1.dist-info → azure_storage_blob-12.27.0.dist-info/licenses}/LICENSE +0 -0
  72. {azure_storage_blob-12.26.0b1.dist-info → azure_storage_blob-12.27.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,384 @@
1
+ # -------------------------------------------------------------------------
2
+ # Copyright (c) Microsoft Corporation. All rights reserved.
3
+ # Licensed under the MIT License. See License.txt in the project root for
4
+ # license information.
5
+ # --------------------------------------------------------------------------
6
+ # pylint: skip-file
7
+
8
+ from datetime import datetime
9
+ from types import TracebackType
10
+ from typing import (
11
+ Any,
12
+ AnyStr,
13
+ AsyncIterable,
14
+ AsyncIterator,
15
+ Awaitable,
16
+ Callable,
17
+ Dict,
18
+ List,
19
+ IO,
20
+ Iterable,
21
+ Optional,
22
+ overload,
23
+ Union,
24
+ )
25
+ from typing_extensions import Self
26
+
27
+ from azure.core import MatchConditions
28
+ from azure.core.async_paging import AsyncItemPaged
29
+ from azure.core.credentials import AzureNamedKeyCredential, AzureSasCredential
30
+ from azure.core.credentials_async import AsyncTokenCredential
31
+ from azure.core.pipeline.transport import AsyncHttpResponse
32
+ from azure.core.tracing.decorator import distributed_trace
33
+ from azure.core.tracing.decorator_async import distributed_trace_async
34
+
35
+ from ._blob_client_async import BlobClient
36
+ from ._blob_service_client_async import BlobServiceClient
37
+ from ._download_async import StorageStreamDownloader
38
+ from ._lease_async import BlobLeaseClient
39
+ from ._list_blobs_helper import BlobPrefix
40
+ from .._encryption import StorageEncryptionMixin
41
+ from .._generated.models import RehydratePriority
42
+ from .._models import (
43
+ AccessPolicy,
44
+ BlobType,
45
+ BlobProperties,
46
+ ContainerEncryptionScope,
47
+ ContainerProperties,
48
+ ContentSettings,
49
+ CustomerProvidedEncryptionKey,
50
+ FilteredBlob,
51
+ PremiumPageBlobTier,
52
+ PublicAccess,
53
+ StandardBlobTier,
54
+ )
55
+ from .._shared.base_client import StorageAccountHostsMixin
56
+ from .._shared.base_client_async import AsyncStorageAccountHostsMixin
57
+
58
+ class ContainerClient( # type: ignore[misc]
59
+ AsyncStorageAccountHostsMixin, StorageAccountHostsMixin, StorageEncryptionMixin
60
+ ):
61
+ account_name: str
62
+ container_name: str
63
+ def __init__(
64
+ self,
65
+ account_url: str,
66
+ container_name: str,
67
+ credential: Optional[
68
+ Union[str, Dict[str, str], AzureNamedKeyCredential, AzureSasCredential, AsyncTokenCredential]
69
+ ] = None,
70
+ *,
71
+ api_version: Optional[str] = None,
72
+ secondary_hostname: Optional[str] = None,
73
+ audience: Optional[str] = None,
74
+ max_block_size: int = 4 * 1024 * 1024,
75
+ max_page_size: int = 4 * 1024 * 1024,
76
+ max_chunk_get_size: int = 4 * 1024 * 1024,
77
+ max_single_put_size: int = 64 * 1024 * 1024,
78
+ max_single_get_size: int = 32 * 1024 * 1024,
79
+ min_large_block_upload_threshold: int = 4 * 1024 * 1024 + 1,
80
+ use_byte_buffer: Optional[bool] = None,
81
+ **kwargs: Any
82
+ ) -> None: ...
83
+ async def __aenter__(self) -> Self: ...
84
+ async def __aexit__(
85
+ self, typ: Optional[type[BaseException]], exc: Optional[BaseException], tb: Optional[TracebackType]
86
+ ) -> None: ...
87
+ async def close(self) -> None: ...
88
+ @classmethod
89
+ def from_container_url(
90
+ cls,
91
+ container_url: str,
92
+ credential: Optional[
93
+ Union[str, Dict[str, str], AzureNamedKeyCredential, AzureSasCredential, AsyncTokenCredential]
94
+ ] = None,
95
+ *,
96
+ api_version: Optional[str] = None,
97
+ secondary_hostname: Optional[str] = None,
98
+ audience: Optional[str] = None,
99
+ max_block_size: int = 4 * 1024 * 1024,
100
+ max_page_size: int = 4 * 1024 * 1024,
101
+ max_chunk_get_size: int = 4 * 1024 * 1024,
102
+ max_single_put_size: int = 64 * 1024 * 1024,
103
+ max_single_get_size: int = 32 * 1024 * 1024,
104
+ min_large_block_upload_threshold: int = 4 * 1024 * 1024 + 1,
105
+ use_byte_buffer: Optional[bool] = None,
106
+ **kwargs: Any
107
+ ) -> Self: ...
108
+ @classmethod
109
+ def from_connection_string(
110
+ cls,
111
+ conn_str: str,
112
+ container_name: str,
113
+ credential: Optional[
114
+ Union[str, Dict[str, str], AzureNamedKeyCredential, AzureSasCredential, AsyncTokenCredential]
115
+ ] = None,
116
+ *,
117
+ api_version: Optional[str] = None,
118
+ secondary_hostname: Optional[str] = None,
119
+ audience: Optional[str] = None,
120
+ max_block_size: int = 4 * 1024 * 1024,
121
+ max_page_size: int = 4 * 1024 * 1024,
122
+ max_chunk_get_size: int = 4 * 1024 * 1024,
123
+ max_single_put_size: int = 64 * 1024 * 1024,
124
+ max_single_get_size: int = 32 * 1024 * 1024,
125
+ min_large_block_upload_threshold: int = 4 * 1024 * 1024 + 1,
126
+ use_byte_buffer: Optional[bool] = None,
127
+ **kwargs: Any
128
+ ) -> Self: ...
129
+ @distributed_trace_async
130
+ async def create_container(
131
+ self,
132
+ metadata: Optional[Dict[str, str]] = None,
133
+ public_access: Optional[Union[PublicAccess, str]] = None,
134
+ *,
135
+ container_encryption_scope: Optional[Union[Dict[str, Any], ContainerEncryptionScope]] = None,
136
+ timeout: Optional[int] = None,
137
+ **kwargs: Any
138
+ ) -> Dict[str, Union[str, datetime]]: ...
139
+ @distributed_trace_async
140
+ async def _rename_container(
141
+ self,
142
+ new_name: str,
143
+ *,
144
+ lease: Optional[Union[BlobLeaseClient, str]] = None,
145
+ timeout: Optional[int] = None,
146
+ **kwargs: Any
147
+ ) -> "ContainerClient": ...
148
+ @distributed_trace_async
149
+ async def delete_container(
150
+ self,
151
+ *,
152
+ lease: Optional[Union[BlobLeaseClient, str]] = None,
153
+ if_modified_since: Optional[datetime] = None,
154
+ if_unmodified_since: Optional[datetime] = None,
155
+ etag: Optional[str] = None,
156
+ match_condition: Optional[MatchConditions] = None,
157
+ timeout: Optional[int] = None,
158
+ **kwargs: Any
159
+ ) -> None: ...
160
+ @distributed_trace_async
161
+ async def acquire_lease(
162
+ self,
163
+ lease_duration: int = -1,
164
+ lease_id: Optional[str] = None,
165
+ *,
166
+ if_modified_since: Optional[datetime] = None,
167
+ if_unmodified_since: Optional[datetime] = None,
168
+ etag: Optional[str] = None,
169
+ match_condition: Optional[MatchConditions] = None,
170
+ timeout: Optional[int] = None,
171
+ **kwargs: Any
172
+ ) -> BlobLeaseClient: ...
173
+ @distributed_trace_async
174
+ async def get_account_information(self, **kwargs: Any) -> Dict[str, str]: ...
175
+ @distributed_trace_async
176
+ async def get_container_properties(
177
+ self, *, lease: Optional[Union[BlobLeaseClient, str]] = None, timeout: Optional[int] = None, **kwargs: Any
178
+ ) -> ContainerProperties: ...
179
+ @distributed_trace_async
180
+ async def exists(self, *, timeout: Optional[int] = None, **kwargs: Any) -> bool: ...
181
+ @distributed_trace_async
182
+ async def set_container_metadata(
183
+ self,
184
+ metadata: Optional[Dict[str, str]] = None,
185
+ *,
186
+ lease: Optional[Union[BlobLeaseClient, str]] = None,
187
+ if_modified_since: Optional[datetime] = None,
188
+ timeout: Optional[int] = None,
189
+ **kwargs: Any
190
+ ) -> Dict[str, Union[str, datetime]]: ...
191
+ @distributed_trace
192
+ def _get_blob_service_client(self) -> BlobServiceClient: ...
193
+ @distributed_trace_async
194
+ async def get_container_access_policy(
195
+ self, *, lease: Optional[Union[BlobLeaseClient, str]] = None, timeout: Optional[int] = None, **kwargs: Any
196
+ ) -> Dict[str, Any]: ...
197
+ @distributed_trace_async
198
+ async def set_container_access_policy(
199
+ self,
200
+ signed_identifiers: Dict[str, AccessPolicy],
201
+ public_access: Optional[Union[str, PublicAccess]] = None,
202
+ *,
203
+ lease: Optional[Union[BlobLeaseClient, str]] = None,
204
+ if_modified_since: Optional[datetime] = None,
205
+ if_unmodified_since: Optional[datetime] = None,
206
+ timeout: Optional[int] = None,
207
+ **kwargs: Any
208
+ ) -> Dict[str, Union[str, datetime]]: ...
209
+ @distributed_trace
210
+ def list_blobs(
211
+ self,
212
+ name_starts_with: Optional[str] = None,
213
+ include: Optional[Union[str, List[str]]] = None,
214
+ *,
215
+ timeout: Optional[int] = None,
216
+ **kwargs: Any
217
+ ) -> AsyncItemPaged[BlobProperties]: ...
218
+ @distributed_trace
219
+ def list_blob_names(
220
+ self, *, name_starts_with: Optional[str] = None, timeout: Optional[int] = None, **kwargs: Any
221
+ ) -> AsyncItemPaged[str]: ...
222
+ @distributed_trace
223
+ def walk_blobs(
224
+ self,
225
+ name_starts_with: Optional[str] = None,
226
+ include: Optional[Union[List[str], str]] = None,
227
+ delimiter: str = "/",
228
+ **kwargs: Any
229
+ ) -> AsyncItemPaged[Union[BlobProperties, BlobPrefix]]: ...
230
+ @distributed_trace
231
+ def find_blobs_by_tags(
232
+ self,
233
+ filter_expression: str,
234
+ *,
235
+ results_per_page: Optional[int] = None,
236
+ timeout: Optional[int] = None,
237
+ **kwargs: Any
238
+ ) -> AsyncItemPaged[FilteredBlob]: ...
239
+ @distributed_trace_async
240
+ async def upload_blob(
241
+ self,
242
+ name: str,
243
+ data: Union[bytes, str, Iterable[AnyStr], AsyncIterable[AnyStr], IO[AnyStr]],
244
+ blob_type: Union[str, BlobType] = BlobType.BLOCKBLOB,
245
+ length: Optional[int] = None,
246
+ metadata: Optional[Dict[str, str]] = None,
247
+ *,
248
+ overwrite: Optional[bool] = None,
249
+ content_settings: Optional[ContentSettings] = None,
250
+ validate_content: Optional[bool] = None,
251
+ lease: Optional[Union[BlobLeaseClient, str]] = None,
252
+ if_modified_since: Optional[datetime] = None,
253
+ if_unmodified_since: Optional[datetime] = None,
254
+ etag: Optional[str] = None,
255
+ match_condition: Optional[MatchConditions] = None,
256
+ if_tags_match_condition: Optional[str] = None,
257
+ timeout: Optional[int] = None,
258
+ premium_page_blob_tier: Optional[PremiumPageBlobTier] = None,
259
+ standard_blob_tier: Optional[StandardBlobTier] = None,
260
+ maxsize_condition: Optional[int] = None,
261
+ max_concurrency: Optional[int] = None,
262
+ cpk: Optional[CustomerProvidedEncryptionKey] = None,
263
+ encryption_scope: Optional[str] = None,
264
+ encoding: Optional[str] = None,
265
+ progress_hook: Optional[Callable[[int, Optional[int]], Awaitable[None]]] = None,
266
+ **kwargs: Any
267
+ ) -> BlobClient: ...
268
+ @distributed_trace_async
269
+ async def delete_blob(
270
+ self,
271
+ blob: str,
272
+ delete_snapshots: Optional[str] = None,
273
+ *,
274
+ version_id: Optional[str] = None,
275
+ lease: Optional[Union[BlobLeaseClient, str]] = None,
276
+ if_modified_since: Optional[datetime] = None,
277
+ if_unmodified_since: Optional[datetime] = None,
278
+ etag: Optional[str] = None,
279
+ match_condition: Optional[MatchConditions] = None,
280
+ if_tags_match_condition: Optional[str] = None,
281
+ timeout: Optional[int] = None,
282
+ **kwargs: Any
283
+ ) -> None: ...
284
+ @overload
285
+ async def download_blob(
286
+ self,
287
+ blob: str,
288
+ offset: Optional[int] = None,
289
+ length: Optional[int] = None,
290
+ *,
291
+ version_id: Optional[str] = None,
292
+ validate_content: Optional[bool] = None,
293
+ lease: Optional[Union[BlobLeaseClient, str]] = None,
294
+ if_modified_since: Optional[datetime] = None,
295
+ if_unmodified_since: Optional[datetime] = None,
296
+ etag: Optional[str] = None,
297
+ match_condition: Optional[MatchConditions] = None,
298
+ if_tags_match_condition: Optional[str] = None,
299
+ cpk: Optional[CustomerProvidedEncryptionKey] = None,
300
+ max_concurrency: Optional[int] = None,
301
+ encoding: str,
302
+ progress_hook: Optional[Callable[[int, int], Awaitable[None]]] = None,
303
+ timeout: Optional[int] = None,
304
+ **kwargs: Any
305
+ ) -> StorageStreamDownloader[str]: ...
306
+ @overload
307
+ async def download_blob(
308
+ self,
309
+ blob: str,
310
+ offset: Optional[int] = None,
311
+ length: Optional[int] = None,
312
+ *,
313
+ version_id: Optional[str] = None,
314
+ validate_content: Optional[bool] = None,
315
+ lease: Optional[Union[BlobLeaseClient, str]] = None,
316
+ if_modified_since: Optional[datetime] = None,
317
+ if_unmodified_since: Optional[datetime] = None,
318
+ etag: Optional[str] = None,
319
+ match_condition: Optional[MatchConditions] = None,
320
+ if_tags_match_condition: Optional[str] = None,
321
+ cpk: Optional[CustomerProvidedEncryptionKey] = None,
322
+ max_concurrency: Optional[int] = None,
323
+ encoding: None = None,
324
+ progress_hook: Optional[Callable[[int, int], Awaitable[None]]] = None,
325
+ timeout: Optional[int] = None,
326
+ **kwargs: Any
327
+ ) -> StorageStreamDownloader[bytes]: ...
328
+ @distributed_trace_async # type: ignore[misc]
329
+ async def download_blob(
330
+ self,
331
+ blob: str,
332
+ offset: Optional[int] = None,
333
+ length: Optional[int] = None,
334
+ *,
335
+ version_id: Optional[str] = None,
336
+ validate_content: Optional[bool] = None,
337
+ lease: Optional[Union[BlobLeaseClient, str]] = None,
338
+ if_modified_since: Optional[datetime] = None,
339
+ if_unmodified_since: Optional[datetime] = None,
340
+ etag: Optional[str] = None,
341
+ match_condition: Optional[MatchConditions] = None,
342
+ if_tags_match_condition: Optional[str] = None,
343
+ cpk: Optional[CustomerProvidedEncryptionKey] = None,
344
+ max_concurrency: Optional[int] = None,
345
+ encoding: Optional[str] = None,
346
+ progress_hook: Optional[Callable[[int, int], Awaitable[None]]] = None,
347
+ timeout: Optional[int] = None,
348
+ **kwargs: Any
349
+ ) -> Union[StorageStreamDownloader[str], StorageStreamDownloader[bytes]]: ...
350
+ @distributed_trace_async
351
+ async def delete_blobs(
352
+ self,
353
+ *blobs: Union[str, Dict[str, Any], BlobProperties],
354
+ delete_snapshots: Optional[str] = None,
355
+ if_modified_since: Optional[datetime] = None,
356
+ if_unmodified_since: Optional[datetime] = None,
357
+ if_tags_match_condition: Optional[str] = None,
358
+ raise_on_any_failure: bool = True,
359
+ timeout: Optional[int] = None,
360
+ **kwargs: Any
361
+ ) -> AsyncIterator[AsyncHttpResponse]: ...
362
+ @distributed_trace_async
363
+ async def set_standard_blob_tier_blobs(
364
+ self,
365
+ standard_blob_tier: Union[str, StandardBlobTier],
366
+ *blobs: Union[str, Dict[str, Any], BlobProperties],
367
+ rehydrate_priority: Optional[RehydratePriority] = None,
368
+ if_tags_match_condition: Optional[str] = None,
369
+ raise_on_any_failure: bool = True,
370
+ timeout: Optional[int] = None,
371
+ **kwargs: Any
372
+ ) -> AsyncIterator[AsyncHttpResponse]: ...
373
+ @distributed_trace_async
374
+ async def set_premium_page_blob_tier_blobs(
375
+ self,
376
+ premium_page_blob_tier: Union[str, PremiumPageBlobTier],
377
+ *blobs: Union[str, Dict[str, Any], BlobProperties],
378
+ raise_on_any_failure: bool = True,
379
+ timeout: Optional[int] = None,
380
+ **kwargs: Any
381
+ ) -> AsyncIterator[AsyncHttpResponse]: ...
382
+ def get_blob_client(
383
+ self, blob: str, snapshot: Optional[str] = None, *, version_id: Optional[str] = None
384
+ ) -> BlobClient: ...
@@ -46,8 +46,10 @@ T = TypeVar('T', bytes, str)
46
46
  async def process_content(data: Any, start_offset: int, end_offset: int, encryption: Dict[str, Any]) -> bytes:
47
47
  if data is None:
48
48
  raise ValueError("Response cannot be None.")
49
- await data.response.load_body()
50
- content = cast(bytes, data.response.body())
49
+ if hasattr(data.response, "is_stream_consumed") and data.response.is_stream_consumed:
50
+ content = data.response.content
51
+ else:
52
+ content = b"".join([d async for d in data])
51
53
  if encryption.get('key') is not None or encryption.get('resolver') is not None:
52
54
  try:
53
55
  return decrypt_blob(
@@ -57,12 +59,14 @@ async def process_content(data: Any, start_offset: int, end_offset: int, encrypt
57
59
  content,
58
60
  start_offset,
59
61
  end_offset,
60
- data.response.headers)
62
+ data.response.headers
63
+ )
61
64
  except Exception as error:
62
65
  raise HttpResponseError(
63
66
  message="Decryption failed.",
64
67
  response=data.response,
65
- error=error) from error
68
+ error=error
69
+ ) from error
66
70
  return content
67
71
 
68
72
 
@@ -449,7 +453,7 @@ class StorageStreamDownloader(Generic[T]): # pylint: disable=too-many-instance-
449
453
 
450
454
  NOTE: If the stream has been partially read, some data may be re-downloaded by the iterator.
451
455
 
452
- :returns: An async iterator of the chunks in the download stream.
456
+ :return: An async iterator of the chunks in the download stream.
453
457
  :rtype: AsyncIterator[bytes]
454
458
 
455
459
  .. admonition:: Example:
@@ -523,7 +527,7 @@ class StorageStreamDownloader(Generic[T]): # pylint: disable=too-many-instance-
523
527
  The number of chars to download from the stream. Leave unspecified
524
528
  or set negative to download all chars. Note, this can only be used
525
529
  when encoding is specified on `download_blob`.
526
- :returns:
530
+ :return:
527
531
  The requested data as bytes or a string if encoding was specified. If
528
532
  the return value is empty, there is no more data to read.
529
533
  :rtype: T
@@ -676,7 +680,7 @@ class StorageStreamDownloader(Generic[T]): # pylint: disable=too-many-instance-
676
680
  Read the entire contents of this blob.
677
681
  This operation is blocking until all data is downloaded.
678
682
 
679
- :returns: The requested data as bytes or a string if encoding was specified.
683
+ :return: The requested data as bytes or a string if encoding was specified.
680
684
  :rtype: T
681
685
  """
682
686
  return await self.read()
@@ -688,7 +692,7 @@ class StorageStreamDownloader(Generic[T]): # pylint: disable=too-many-instance-
688
692
  The stream to download to. This can be an open file-handle,
689
693
  or any writable stream. The stream must be seekable if the download
690
694
  uses more than one parallel connection.
691
- :returns: The number of bytes read.
695
+ :return: The number of bytes read.
692
696
  :rtype: int
693
697
  """
694
698
  if self._text_mode:
@@ -805,7 +809,7 @@ class StorageStreamDownloader(Generic[T]): # pylint: disable=too-many-instance-
805
809
 
806
810
  :param int max_concurrency:
807
811
  The number of parallel connections with which to download.
808
- :returns: The contents of the file as bytes.
812
+ :return: The contents of the file as bytes.
809
813
  :rtype: bytes
810
814
  """
811
815
  warnings.warn(
@@ -830,7 +834,7 @@ class StorageStreamDownloader(Generic[T]): # pylint: disable=too-many-instance-
830
834
  The number of parallel connections with which to download.
831
835
  :param str encoding:
832
836
  Test encoding to decode the downloaded bytes. Default is UTF-8.
833
- :returns: The content of the file as a str.
837
+ :return: The content of the file as a str.
834
838
  :rtype: str
835
839
  """
836
840
  warnings.warn(
@@ -856,7 +860,7 @@ class StorageStreamDownloader(Generic[T]): # pylint: disable=too-many-instance-
856
860
  uses more than one parallel connection.
857
861
  :param int max_concurrency:
858
862
  The number of parallel connections with which to download.
859
- :returns: The properties of the downloaded blob.
863
+ :return: The properties of the downloaded blob.
860
864
  :rtype: Any
861
865
  """
862
866
  warnings.warn(
@@ -19,7 +19,7 @@ if TYPE_CHECKING:
19
19
  from datetime import datetime
20
20
 
21
21
 
22
- class BlobLeaseClient(): # pylint: disable=client-accepts-api-version-keyword
22
+ class BlobLeaseClient: # pylint: disable=client-accepts-api-version-keyword
23
23
  """Creates a new BlobLeaseClient.
24
24
 
25
25
  This client provides lease operations on a BlobClient or ContainerClient.
@@ -40,7 +40,7 @@ class BlobLeaseClient(): # pylint: disable=client-accepts-api-version-keyword
40
40
  """The last modified timestamp of the lease currently being maintained.
41
41
  This will be `None` if no lease has yet been acquired or modified."""
42
42
 
43
- def __init__( # pylint: disable=missing-client-constructor-parameter-credential, missing-client-constructor-parameter-kwargs
43
+ def __init__( # pylint: disable=missing-client-constructor-parameter-credential, missing-client-constructor-parameter-kwargs
44
44
  self, client: Union["BlobClient", "ContainerClient"],
45
45
  lease_id: Optional[str] = None
46
46
  ) -> None:
@@ -107,6 +107,7 @@ class BlobLeaseClient(): # pylint: disable=client-accepts-api-version-keyword
107
107
  This value is not tracked or validated on the client. To configure client-side network timesouts
108
108
  see `here <https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/storage/azure-storage-blob
109
109
  #other-client--per-operation-configuration>`__.
110
+ :return: None
110
111
  :rtype: None
111
112
  """
112
113
  mod_conditions = get_modify_conditions(kwargs)
@@ -0,0 +1,81 @@
1
+ # -------------------------------------------------------------------------
2
+ # Copyright (c) Microsoft Corporation. All rights reserved.
3
+ # Licensed under the MIT License. See License.txt in the project root for
4
+ # license information.
5
+ # --------------------------------------------------------------------------
6
+ # pylint: skip-file
7
+
8
+ from datetime import datetime
9
+ from typing import Any, Optional, Union
10
+
11
+ from azure.core import MatchConditions
12
+ from azure.core.tracing.decorator_async import distributed_trace_async
13
+ from ._blob_client_async import BlobClient
14
+ from ._container_client_async import ContainerClient
15
+
16
+ class BlobLeaseClient:
17
+ id: str
18
+ etag: Optional[str]
19
+ last_modified: Optional[datetime]
20
+ def __init__(self, client: Union[BlobClient, ContainerClient], lease_id: Optional[str] = None) -> None: ...
21
+ @distributed_trace_async
22
+ async def acquire(
23
+ self,
24
+ lease_duration: int = -1,
25
+ *,
26
+ if_modified_since: Optional[datetime] = None,
27
+ if_unmodified_since: Optional[datetime] = None,
28
+ etag: Optional[str] = None,
29
+ match_condition: Optional[MatchConditions] = None,
30
+ if_tags_match_condition: Optional[str] = None,
31
+ timeout: Optional[int] = None,
32
+ **kwargs: Any
33
+ ) -> None: ...
34
+ @distributed_trace_async
35
+ async def renew(
36
+ self,
37
+ *,
38
+ if_modified_since: Optional[datetime] = None,
39
+ if_unmodified_since: Optional[datetime] = None,
40
+ etag: Optional[str] = None,
41
+ match_condition: Optional[MatchConditions] = None,
42
+ if_tags_match_condition: Optional[str] = None,
43
+ timeout: Optional[int] = None,
44
+ **kwargs: Any
45
+ ) -> None: ...
46
+ @distributed_trace_async
47
+ async def release(
48
+ self,
49
+ *,
50
+ if_modified_since: Optional[datetime] = None,
51
+ if_unmodified_since: Optional[datetime] = None,
52
+ etag: Optional[str] = None,
53
+ match_condition: Optional[MatchConditions] = None,
54
+ if_tags_match_condition: Optional[str] = None,
55
+ timeout: Optional[int] = None,
56
+ **kwargs: Any
57
+ ) -> None: ...
58
+ @distributed_trace_async
59
+ async def change(
60
+ self,
61
+ proposed_lease_id: str,
62
+ *,
63
+ if_modified_since: Optional[datetime] = None,
64
+ if_unmodified_since: Optional[datetime] = None,
65
+ etag: Optional[str] = None,
66
+ match_condition: Optional[MatchConditions] = None,
67
+ if_tags_match_condition: Optional[str] = None,
68
+ timeout: Optional[int] = None,
69
+ **kwargs: Any
70
+ ) -> None: ...
71
+ @distributed_trace_async
72
+ async def break_lease(
73
+ self,
74
+ lease_break_period: Optional[int] = None,
75
+ *,
76
+ if_modified_since: Optional[datetime] = None,
77
+ if_unmodified_since: Optional[datetime] = None,
78
+ if_tags_match_condition: Optional[str] = None,
79
+ timeout: Optional[int] = None,
80
+ **kwargs: Any
81
+ ) -> int: ...
@@ -88,7 +88,7 @@ class BlobQueryReader: # pylint: disable=too-many-instance-attributes
88
88
 
89
89
  This operation is blocking until all data is downloaded.
90
90
 
91
- :returns: The query results.
91
+ :return: The query results.
92
92
  :rtype: bytes
93
93
  """
94
94
  stream = BytesIO()
@@ -104,7 +104,7 @@ class BlobQueryReader: # pylint: disable=too-many-instance-attributes
104
104
  :param IO stream:
105
105
  The stream to download to. This can be an open file-handle,
106
106
  or any writable stream.
107
- :returns: None
107
+ :return: None
108
108
  """
109
109
  async for record in self._aiter_stream():
110
110
  stream.write(record)
@@ -114,7 +114,7 @@ class BlobQueryReader: # pylint: disable=too-many-instance-attributes
114
114
 
115
115
  Records will be returned line by line.
116
116
 
117
- :returns: A record generator for the query result.
117
+ :return: A record generator for the query result.
118
118
  :rtype: AsyncIterable[bytes]
119
119
  """
120
120
  delimiter = self.record_delimiter.encode('utf-8')
@@ -1,23 +1,22 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: azure-storage-blob
3
- Version: 12.26.0b1
3
+ Version: 12.27.0
4
4
  Summary: Microsoft Azure Blob Storage Client Library for Python
5
5
  Home-page: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/storage/azure-storage-blob
6
6
  Author: Microsoft Corporation
7
7
  Author-email: ascl@microsoft.com
8
8
  License: MIT License
9
9
  Keywords: azure,azure sdk
10
- Classifier: Development Status :: 4 - Beta
10
+ Classifier: Development Status :: 5 - Production/Stable
11
11
  Classifier: Programming Language :: Python
12
12
  Classifier: Programming Language :: Python :: 3 :: Only
13
13
  Classifier: Programming Language :: Python :: 3
14
- Classifier: Programming Language :: Python :: 3.8
15
14
  Classifier: Programming Language :: Python :: 3.9
16
15
  Classifier: Programming Language :: Python :: 3.10
17
16
  Classifier: Programming Language :: Python :: 3.11
18
17
  Classifier: Programming Language :: Python :: 3.12
19
18
  Classifier: License :: OSI Approved :: MIT License
20
- Requires-Python: >=3.8
19
+ Requires-Python: >=3.9
21
20
  Description-Content-Type: text/markdown
22
21
  License-File: LICENSE
23
22
  Requires-Dist: azure-core>=1.30.0
@@ -26,6 +25,19 @@ Requires-Dist: typing-extensions>=4.6.0
26
25
  Requires-Dist: isodate>=0.6.1
27
26
  Provides-Extra: aio
28
27
  Requires-Dist: azure-core[aio]>=1.30.0; extra == "aio"
28
+ Dynamic: author
29
+ Dynamic: author-email
30
+ Dynamic: classifier
31
+ Dynamic: description
32
+ Dynamic: description-content-type
33
+ Dynamic: home-page
34
+ Dynamic: keywords
35
+ Dynamic: license
36
+ Dynamic: license-file
37
+ Dynamic: provides-extra
38
+ Dynamic: requires-dist
39
+ Dynamic: requires-python
40
+ Dynamic: summary
29
41
 
30
42
  # Azure Storage Blobs client library for Python
31
43
  Azure Blob storage is Microsoft's object storage solution for the cloud. Blob storage is optimized for storing massive amounts of unstructured data, such as text or binary data.
@@ -49,7 +61,7 @@ Blob storage is ideal for:
49
61
  ## Getting started
50
62
 
51
63
  ### Prerequisites
52
- * Python 3.8 or later is required to use this package. For more details, please read our page on [Azure SDK for Python version support policy](https://github.com/Azure/azure-sdk-for-python/wiki/Azure-SDKs-Python-version-support-policy).
64
+ * Python 3.9 or later is required to use this package. For more details, please read our page on [Azure SDK for Python version support policy](https://github.com/Azure/azure-sdk-for-python/wiki/Azure-SDKs-Python-version-support-policy).
53
65
  * You must have an [Azure subscription](https://azure.microsoft.com/free/) and an
54
66
  [Azure storage account](https://learn.microsoft.com/azure/storage/common/storage-account-overview) to use this package.
55
67