You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| files | Iterable[MemberFile] | The member files of the ZIP
36
-
| chunk_size | int | How many bytes of each member file to fetch before compressing
36
+
| chunk_size | int | Maximum `bytes` instance length yielded to client code
37
37
| get_compressobj | Callable[[], 'zlib._Compress']| A function returning a [Python zlib compression object](https://docs.python.org/3/library/zlib.html#zlib.compressobj)|
38
38
| password | Optional[str] | The password used to encrypt all the member files with AES-256 encryption adhering to the Winzip AE-2 specification - see [Password protection](/get-started/password-protection/)
39
39
| extended_timestamps | bool | Whether to save extended timestamps in the ZIP file
| files | AsyncIterable[AsyncMemberFile] | The member files of the ZIP
85
-
| chunk_size | int | How many bytes of each member file to fetch before compressing
85
+
| chunk_size | int | Maximum `bytes` instance length yielded to client code
86
86
| get_compressobj | Callable[[], 'zlib._Compress']| A function returning a [Python zlib compression object](https://docs.python.org/3/library/zlib.html#zlib.compressobj)|
87
87
| password | Optional[str] | The password used to encrypt all the member files with AES-256 encryption adhering to the Winzip AE-2 specification - see [Password protection](/get-started/password-protection/)
88
88
| extended_timestamps | bool | Whether to save extended timestamps in the ZIP file
Copy file name to clipboardExpand all lines: docs/get-started/advanced-usage.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,16 +23,16 @@ If you wish to disable compression entirely for these methods, you can pass `lev
23
23
24
24
## Custom chunk size
25
25
26
-
The default `bytes` instance size is 65536 bytes. To customise this, you can override the `chunk_size` parameter.
26
+
The default `bytes` instance size for output is 65536 bytes. To customise this, you can override the `chunk_size` parameter.
27
27
28
28
```python
29
29
for zipped_chunk in stream_zip(unzipped_files(), chunk_size=65536):
30
30
print(zipped_chunk)
31
31
```
32
32
33
-
This one size is used both for input - splitting or gathering any uncompressed data into `chunk_size`bytes before attempting to compress it, and in output - splitting or gathering any compressed data into `chunk_size` bytes before returning it to client code.
33
+
This size is used to buffer output - splitting or gathering any compressed data into a `chunk_size`buffer before yielding it to client code. There may be performance differences with different `chunk_size` values; the default chunk_size may not be optimal for your use case.
34
34
35
-
There may be performance differences with different `chunk_size` values. The default chunk_size may not be optimal for your use case.
35
+
The buffer is flushed just before iterating over the bytes of each member file, irrespective of `chunk_size`.
0 commit comments