py7zz 1.2.0__py3-none-win_arm64.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.
LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 py7zz contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,154 @@
1
+ SPDX-FileCopyrightText: 1999-2025 Igor Pavlov
2
+ SPDX-License-Identifier: LicenseRef-7zip
3
+
4
+ 7-Zip source code
5
+ ~~~~~~~~~~~~~~~~~
6
+ License for use and distribution
7
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
8
+
9
+ 7-Zip Copyright (C) 1999-2025 Igor Pavlov.
10
+
11
+ The licenses for files are:
12
+
13
+ - CPP/7zip/Compress/Rar* files: the "GNU LGPL" with "unRAR license restriction"
14
+ - CPP/7zip/Compress/LzfseDecoder.cpp: the "BSD 3-clause License"
15
+ - C/ZstdDec.c: the "BSD 3-clause License"
16
+ - C/Xxh64.c: the "BSD 2-clause License"
17
+ - Some files are "public domain" files, if "public domain" status is stated in source file.
18
+ - the "GNU LGPL" for all other files. If there is no license information in
19
+ some source file, that file is under the "GNU LGPL".
20
+
21
+ The "GNU LGPL" with "unRAR license restriction" means that you must follow both
22
+ "GNU LGPL" rules and "unRAR license restriction" rules.
23
+
24
+
25
+
26
+
27
+ GNU LGPL information
28
+ --------------------
29
+
30
+ This library is free software; you can redistribute it and/or
31
+ modify it under the terms of the GNU Lesser General Public
32
+ License as published by the Free Software Foundation; either
33
+ version 2.1 of the License, or (at your option) any later version.
34
+
35
+ This library is distributed in the hope that it will be useful,
36
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
37
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
38
+ Lesser General Public License for more details.
39
+
40
+ You should have received a copy of the GNU Lesser General Public
41
+ License along with this library; if not,
42
+ you can get a copy of the GNU Lesser General Public License from
43
+ http://www.gnu.org/
44
+
45
+
46
+
47
+
48
+ BSD 3-clause License in 7-Zip code
49
+ ----------------------------------
50
+
51
+ The "BSD 3-clause License" is used for the following code in 7z.dll
52
+ 1) LZFSE data decompression.
53
+ CPP/7zip/Compress/LzfseDecoder.cpp.
54
+ That code was derived from the code in the "LZFSE compression library" developed by Apple Inc,
55
+ that also uses the "BSD 3-clause License".
56
+ 2) ZSTD data decompression.
57
+ C/ZstdDec.c
58
+ that code was developed using original zstd decoder code as reference code.
59
+ The original zstd decoder code was developed by Facebook Inc,
60
+ that also uses the "BSD 3-clause License".
61
+
62
+ Copyright (c) 2015-2016, Apple Inc. All rights reserved.
63
+ Copyright (c) Facebook, Inc. All rights reserved.
64
+ Copyright (c) 2023-2025 Igor Pavlov.
65
+
66
+ Text of the "BSD 3-clause License"
67
+ ----------------------------------
68
+
69
+ Redistribution and use in source and binary forms, with or without modification,
70
+ are permitted provided that the following conditions are met:
71
+
72
+ 1. Redistributions of source code must retain the above copyright notice, this
73
+ list of conditions and the following disclaimer.
74
+
75
+ 2. Redistributions in binary form must reproduce the above copyright notice,
76
+ this list of conditions and the following disclaimer in the documentation
77
+ and/or other materials provided with the distribution.
78
+
79
+ 3. Neither the name of the copyright holder nor the names of its contributors may
80
+ be used to endorse or promote products derived from this software without
81
+ specific prior written permission.
82
+
83
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
84
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
85
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
86
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
87
+ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
88
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
89
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
90
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
91
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
92
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
93
+
94
+ ---
95
+
96
+
97
+
98
+
99
+ BSD 2-clause License in 7-Zip code
100
+ ----------------------------------
101
+
102
+ The "BSD 2-clause License" is used for the XXH64 code in 7-Zip.
103
+ C/Xxh64.c
104
+
105
+ XXH64 code in 7-Zip was derived from the original XXH64 code developed by Yann Collet.
106
+
107
+ Copyright (c) 2012-2021 Yann Collet.
108
+ Copyright (c) 2023-2025 Igor Pavlov.
109
+
110
+ Text of the "BSD 2-clause License"
111
+ ----------------------------------
112
+
113
+ Redistribution and use in source and binary forms, with or without modification,
114
+ are permitted provided that the following conditions are met:
115
+
116
+ 1. Redistributions of source code must retain the above copyright notice, this
117
+ list of conditions and the following disclaimer.
118
+
119
+ 2. Redistributions in binary form must reproduce the above copyright notice,
120
+ this list of conditions and the following disclaimer in the documentation
121
+ and/or other materials provided with the distribution.
122
+
123
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
124
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
125
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
126
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
127
+ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
128
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
129
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
130
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
131
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
132
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
133
+
134
+ ---
135
+
136
+
137
+
138
+
139
+ unRAR license restriction
140
+ -------------------------
141
+
142
+ The decompression engine for RAR archives was developed using source
143
+ code of unRAR program.
144
+ All copyrights to original unRAR code are owned by Alexander Roshal.
145
+
146
+ The license for original unRAR code has the following restriction:
147
+
148
+ The unRAR sources cannot be used to re-create the RAR compression algorithm,
149
+ which is proprietary. Distribution of modified unRAR sources in separate form
150
+ or as a part of other software is permitted, provided that it is clearly
151
+ stated in the documentation and source comments that the code may
152
+ not be used to develop a RAR (WinRAR) compatible archiver.
153
+
154
+ --
THIRD_PARTY_NOTICES.md ADDED
@@ -0,0 +1,21 @@
1
+ <!--
2
+ SPDX-FileCopyrightText: 2025 py7zz contributors
3
+ SPDX-License-Identifier: MIT
4
+ -->
5
+
6
+ # Third-Party Notices
7
+
8
+ <!--
9
+ SPDX-FileCopyrightText: 1999-2025 Igor Pavlov
10
+ SPDX-License-Identifier: LicenseRef-7zip
11
+ -->
12
+
13
+ This distribution bundles the official **7-Zip** console binary **7zz**.
14
+
15
+ - Upstream: https://www.7-zip.org/
16
+ - License: **GNU LGPL v2.1** (+ **unRAR restriction**); parts under **BSD**.
17
+ - Copyright: © 1999–2025 Igor Pavlov
18
+ - Full text: see `LICENSES/LicenseRef-7zip.txt`
19
+ - Source availability: 7-Zip source is available from the upstream website.
20
+
21
+ The Python source code of this project is licensed under the **MIT License** (see `LICENSE`).
py7zz/7zz_version.txt ADDED
@@ -0,0 +1 @@
1
+ 26.01
py7zz/__init__.py ADDED
@@ -0,0 +1,380 @@
1
+ # SPDX-License-Identifier: MIT
2
+ # SPDX-FileCopyrightText: 2025 py7zz contributors
3
+ """
4
+ py7zz - Python wrapper for 7zz CLI tool
5
+
6
+ Provides a consistent OOP interface across platforms (macOS, Linux, Windows)
7
+ with automatic update mechanisms and Windows filename compatibility.
8
+ """
9
+
10
+ # Initialize logging early
11
+ from .logging_config import ensure_default_logging
12
+
13
+ ensure_default_logging()
14
+
15
+ # Bundled information
16
+ # Archive information classes
17
+ from .archive_info import ArchiveInfo # noqa: E402
18
+ from .bundled_info import ( # noqa: E402
19
+ get_bundled_7zz_version,
20
+ get_release_type,
21
+ get_version_info,
22
+ is_auto_release,
23
+ is_dev_release,
24
+ is_stable_release,
25
+ )
26
+
27
+ # Structured callback system
28
+ from .callbacks import ( # noqa: E402
29
+ OperationStage,
30
+ OperationType,
31
+ ProgressCallback,
32
+ ProgressInfo,
33
+ ProgressTracker,
34
+ console_progress_callback,
35
+ create_callback,
36
+ detailed_console_callback,
37
+ json_progress_callback,
38
+ )
39
+
40
+ # Configuration and Presets
41
+ from .config import ( # noqa: E402
42
+ Config,
43
+ GlobalConfig,
44
+ PresetRecommender,
45
+ Presets,
46
+ create_custom_config,
47
+ get_recommended_preset,
48
+ )
49
+
50
+ # Core functionality
51
+ from .core import ArchiveFileReader, SevenZipFile, run_7z # noqa: E402
52
+
53
+ # Exceptions
54
+ from .exceptions import ( # noqa: E402
55
+ ArchiveNotFoundError,
56
+ BinaryNotFoundError,
57
+ CompatibilityError,
58
+ CompressionError,
59
+ ConfigurationError,
60
+ CorruptedArchiveError,
61
+ ExtractionError,
62
+ FilenameCompatibilityError,
63
+ FileNotFoundError,
64
+ InsufficientSpaceError,
65
+ InvalidPasswordError,
66
+ OperationError,
67
+ OperationTimeoutError,
68
+ PasswordRequiredError,
69
+ Py7zzError,
70
+ SecurityError,
71
+ UnsupportedFormatError,
72
+ # Enhanced exception classes
73
+ ValidationError,
74
+ ZipBombError,
75
+ # Error utility functions
76
+ classify_error_type,
77
+ get_error_suggestions,
78
+ # Error handling decorators
79
+ handle_7z_errors,
80
+ handle_file_errors,
81
+ handle_validation_errors,
82
+ )
83
+
84
+ # Filename sanitization utilities
85
+ from .filename_sanitizer import ( # noqa: E402
86
+ get_safe_filename,
87
+ is_valid_windows_filename,
88
+ sanitize_filename_simple as sanitize_filename,
89
+ )
90
+
91
+ # Logging configuration
92
+ from .logging_config import ( # noqa: E402
93
+ PerformanceLogger,
94
+ clear_logging_handlers,
95
+ disable_file_logging,
96
+ disable_warnings,
97
+ enable_debug_logging,
98
+ enable_file_logging,
99
+ enable_performance_monitoring,
100
+ enable_structured_logging,
101
+ get_log_statistics,
102
+ get_logging_config,
103
+ log_performance,
104
+ performance_decorator,
105
+ set_log_level,
106
+ setup_logging,
107
+ )
108
+
109
+ # Security utilities
110
+ from .security import ( # noqa: E402
111
+ SecurityConfig,
112
+ check_file_count_security,
113
+ get_default_security_config,
114
+ perform_security_checks,
115
+ set_default_security_config,
116
+ )
117
+
118
+ # Simple Function API (Layer 1)
119
+ from .simple import ( # noqa: E402
120
+ # Advanced convenience functions
121
+ batch_create_archives,
122
+ batch_extract_archives,
123
+ compare_archives,
124
+ # Basic operations
125
+ compress_directory,
126
+ compress_file,
127
+ convert_archive_format,
128
+ copy_archive,
129
+ create_archive,
130
+ extract_archive,
131
+ get_archive_format,
132
+ get_archive_info,
133
+ get_compression_ratio,
134
+ list_archive,
135
+ recompress_archive,
136
+ test_archive,
137
+ )
138
+
139
+ # Streaming interface for cloud integration
140
+ from .streaming import ( # noqa: E402
141
+ ArchiveStreamReader,
142
+ ArchiveStreamWriter,
143
+ create_stream_reader,
144
+ create_stream_writer,
145
+ )
146
+
147
+ # Thread-safe configuration management
148
+ from .thread_safe_config import ( # noqa: E402
149
+ PRESET_CONFIGS,
150
+ ImmutableConfig,
151
+ ThreadSafeGlobalConfig,
152
+ apply_preset,
153
+ get_preset_config,
154
+ with_preset,
155
+ )
156
+
157
+ # Version information
158
+ from .version import ( # noqa: E402
159
+ generate_auto_version,
160
+ generate_dev_version,
161
+ get_base_version,
162
+ get_build_number,
163
+ get_version,
164
+ get_version_type,
165
+ is_auto_version,
166
+ is_dev_version,
167
+ is_stable_version,
168
+ parse_version,
169
+ )
170
+
171
+ # Get dynamic version from the version module with error handling
172
+ try:
173
+ __version__ = get_version()
174
+ except Exception:
175
+ # Fallback to a reasonable default if version detection fails
176
+ __version__ = "1.1.1"
177
+ from .version import ( # noqa: E402
178
+ get_version_info as get_legacy_version_info,
179
+ )
180
+
181
+ # Import async simple functions if available
182
+ try:
183
+ from .simple import (
184
+ compress_directory_async, # noqa: F401
185
+ compress_file_async, # noqa: F401
186
+ create_archive_async, # noqa: F401
187
+ extract_archive_async, # noqa: F401
188
+ )
189
+
190
+ _simple_async_available = True
191
+ except ImportError:
192
+ _simple_async_available = False
193
+
194
+ # Optional compression algorithm interface
195
+ try:
196
+ from .compression import (
197
+ Compressor, # noqa: F401
198
+ Decompressor, # noqa: F401
199
+ bzip2_compress, # noqa: F401
200
+ bzip2_decompress, # noqa: F401
201
+ compress, # noqa: F401
202
+ decompress, # noqa: F401
203
+ lzma2_compress, # noqa: F401
204
+ lzma2_decompress, # noqa: F401
205
+ )
206
+
207
+ _compression_available = True
208
+ except ImportError:
209
+ _compression_available = False
210
+
211
+ # Optional async operations interface
212
+ try:
213
+ from .async_ops import (
214
+ AsyncSevenZipFile, # noqa: F401
215
+ batch_compress_async, # noqa: F401
216
+ batch_extract_async, # noqa: F401
217
+ compress_async, # noqa: F401
218
+ extract_async, # noqa: F401
219
+ )
220
+ from .async_ops import (
221
+ ProgressInfo as AsyncProgressInfo, # noqa: F401
222
+ )
223
+
224
+ _async_available = True
225
+ except ImportError:
226
+ _async_available = False
227
+
228
+ # Build __all__ list based on available modules
229
+ __all__ = [
230
+ # Core API (Layer 2)
231
+ "SevenZipFile",
232
+ "ArchiveFileReader",
233
+ "run_7z",
234
+ # Archive information classes
235
+ "ArchiveInfo",
236
+ # Version information
237
+ "__version__",
238
+ "get_version",
239
+ "get_version_info",
240
+ "get_legacy_version_info",
241
+ "parse_version",
242
+ "generate_auto_version",
243
+ "generate_dev_version",
244
+ "get_version_type",
245
+ "is_auto_version",
246
+ "is_dev_version",
247
+ "is_stable_version",
248
+ "get_base_version",
249
+ "get_build_number",
250
+ # Bundled information
251
+ "get_bundled_7zz_version",
252
+ "get_release_type",
253
+ "is_stable_release",
254
+ "is_auto_release",
255
+ "is_dev_release",
256
+ # Simple API (Layer 1) - Basic operations
257
+ "create_archive",
258
+ "extract_archive",
259
+ "list_archive",
260
+ "compress_file",
261
+ "compress_directory",
262
+ "get_archive_info",
263
+ "test_archive",
264
+ # Simple API (Layer 1) - Advanced convenience functions
265
+ "batch_create_archives",
266
+ "batch_extract_archives",
267
+ "copy_archive",
268
+ "get_compression_ratio",
269
+ "get_archive_format",
270
+ "compare_archives",
271
+ "convert_archive_format",
272
+ "recompress_archive",
273
+ # Configuration
274
+ "Config",
275
+ "Presets",
276
+ "create_custom_config",
277
+ "get_recommended_preset",
278
+ # Logging
279
+ "setup_logging",
280
+ "enable_debug_logging",
281
+ "disable_warnings",
282
+ # Exceptions
283
+ "Py7zzError",
284
+ "FileNotFoundError",
285
+ "ArchiveNotFoundError",
286
+ "CompressionError",
287
+ "ExtractionError",
288
+ "CorruptedArchiveError",
289
+ "UnsupportedFormatError",
290
+ "PasswordRequiredError",
291
+ "InvalidPasswordError",
292
+ "BinaryNotFoundError",
293
+ "InsufficientSpaceError",
294
+ "ConfigurationError",
295
+ "OperationTimeoutError",
296
+ "FilenameCompatibilityError",
297
+ "SecurityError",
298
+ "ZipBombError",
299
+ # Enhanced exception handling
300
+ "ValidationError",
301
+ "OperationError",
302
+ "CompatibilityError",
303
+ "handle_7z_errors",
304
+ "handle_file_errors",
305
+ "handle_validation_errors",
306
+ "classify_error_type",
307
+ "get_error_suggestions",
308
+ # Filename sanitization utilities
309
+ "sanitize_filename",
310
+ "is_valid_windows_filename",
311
+ "get_safe_filename",
312
+ # Security utilities
313
+ "SecurityConfig",
314
+ "check_file_count_security",
315
+ "get_default_security_config",
316
+ "perform_security_checks",
317
+ "set_default_security_config",
318
+ ]
319
+
320
+ # Add compression API if available
321
+ if _compression_available:
322
+ __all__.extend(
323
+ [
324
+ # Core compression functions
325
+ "compress",
326
+ "decompress",
327
+ # Compressor classes
328
+ "BaseCompressor",
329
+ "Compressor",
330
+ "Decompressor",
331
+ "StreamCompressor",
332
+ "StreamDecompressor",
333
+ # Algorithm-specific functions
334
+ "lzma2_compress",
335
+ "lzma2_decompress",
336
+ "bzip2_compress",
337
+ "bzip2_decompress",
338
+ "ppmd_compress",
339
+ "ppmd_decompress",
340
+ "deflate_compress",
341
+ "deflate_decompress",
342
+ # Utility functions
343
+ "get_algorithm_info",
344
+ "list_algorithms",
345
+ "recommend_algorithm",
346
+ "benchmark_algorithms",
347
+ "compress_with_preset",
348
+ "create_compressor_from_preset",
349
+ "get_compression_info",
350
+ "compress_file_content",
351
+ "decompress_file_content",
352
+ ]
353
+ )
354
+
355
+ # Add async API if available
356
+ if _async_available:
357
+ __all__.extend(
358
+ [
359
+ "AsyncSevenZipFile",
360
+ "ProgressInfo",
361
+ "compress_async",
362
+ "extract_async",
363
+ "batch_compress_async",
364
+ "batch_extract_async",
365
+ ]
366
+ )
367
+
368
+ # Add async simple API if available
369
+ if _simple_async_available:
370
+ __all__.extend(
371
+ [
372
+ "create_archive_async",
373
+ "extract_archive_async",
374
+ "compress_file_async",
375
+ "compress_directory_async",
376
+ ]
377
+ )
378
+
379
+ # Version is now managed centrally in version.py
380
+ # __version__ is imported from .version at the top of this file