zstd 1.5.6.1__tar.gz → 1.5.6.2__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {zstd-1.5.6.1 → zstd-1.5.6.2}/PKG-INFO +72 -9
- zstd-1.5.6.1/src/zstd.egg-info/PKG-INFO → zstd-1.5.6.2/README.rst +57 -34
- {zstd-1.5.6.1 → zstd-1.5.6.2}/setup.py +39 -8
- {zstd-1.5.6.1 → zstd-1.5.6.2}/src/python-zstd.c +74 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/src/python-zstd.h +8 -1
- zstd-1.5.6.1/README.rst → zstd-1.5.6.2/src/zstd.egg-info/PKG-INFO +97 -6
- {zstd-1.5.6.1 → zstd-1.5.6.2}/src/zstd.egg-info/SOURCES.txt +2 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/tests/base.py +1 -1
- zstd-1.5.6.2/tests/test_decompress.py +24 -0
- zstd-1.5.6.2/tests/test_speed.py +52 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/LICENSE +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/MANIFEST.in +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/setup.cfg +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/src/pythoncapi_compat.h +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/src/util.c +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/src/util.h +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/src/zstd.egg-info/dependency_links.txt +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/src/zstd.egg-info/top_level.txt +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/tests/__init__.py +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/tests/test_compress.py +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/tests/test_version.py +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/zstd/lib/common/allocations.h +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/zstd/lib/common/bits.h +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/zstd/lib/common/bitstream.h +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/zstd/lib/common/compiler.h +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/zstd/lib/common/cpu.h +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/zstd/lib/common/debug.c +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/zstd/lib/common/debug.h +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/zstd/lib/common/entropy_common.c +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/zstd/lib/common/error_private.c +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/zstd/lib/common/error_private.h +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/zstd/lib/common/fse.h +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/zstd/lib/common/fse_decompress.c +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/zstd/lib/common/huf.h +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/zstd/lib/common/mem.h +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/zstd/lib/common/pool.c +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/zstd/lib/common/pool.h +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/zstd/lib/common/portability_macros.h +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/zstd/lib/common/threading.c +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/zstd/lib/common/threading.h +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/zstd/lib/common/xxhash.c +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/zstd/lib/common/xxhash.h +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/zstd/lib/common/zstd_common.c +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/zstd/lib/common/zstd_deps.h +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/zstd/lib/common/zstd_internal.h +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/zstd/lib/common/zstd_trace.h +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/zstd/lib/compress/clevels.h +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/zstd/lib/compress/fse_compress.c +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/zstd/lib/compress/hist.c +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/zstd/lib/compress/hist.h +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/zstd/lib/compress/huf_compress.c +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/zstd/lib/compress/zstd_compress.c +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/zstd/lib/compress/zstd_compress_internal.h +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/zstd/lib/compress/zstd_compress_literals.c +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/zstd/lib/compress/zstd_compress_literals.h +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/zstd/lib/compress/zstd_compress_sequences.c +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/zstd/lib/compress/zstd_compress_sequences.h +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/zstd/lib/compress/zstd_compress_superblock.c +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/zstd/lib/compress/zstd_compress_superblock.h +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/zstd/lib/compress/zstd_cwksp.h +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/zstd/lib/compress/zstd_double_fast.c +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/zstd/lib/compress/zstd_double_fast.h +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/zstd/lib/compress/zstd_fast.c +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/zstd/lib/compress/zstd_fast.h +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/zstd/lib/compress/zstd_lazy.c +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/zstd/lib/compress/zstd_lazy.h +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/zstd/lib/compress/zstd_ldm.c +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/zstd/lib/compress/zstd_ldm.h +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/zstd/lib/compress/zstd_ldm_geartab.h +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/zstd/lib/compress/zstd_opt.c +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/zstd/lib/compress/zstd_opt.h +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/zstd/lib/compress/zstdmt_compress.c +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/zstd/lib/compress/zstdmt_compress.h +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/zstd/lib/decompress/huf_decompress.c +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/zstd/lib/decompress/huf_decompress_amd64.S +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/zstd/lib/decompress/zstd_ddict.c +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/zstd/lib/decompress/zstd_ddict.h +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/zstd/lib/decompress/zstd_decompress.c +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/zstd/lib/decompress/zstd_decompress_block.c +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/zstd/lib/decompress/zstd_decompress_block.h +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/zstd/lib/decompress/zstd_decompress_internal.h +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/zstd/lib/legacy/zstd_legacy.h +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/zstd/lib/legacy/zstd_v01.c +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/zstd/lib/legacy/zstd_v01.h +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/zstd/lib/legacy/zstd_v02.c +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/zstd/lib/legacy/zstd_v02.h +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/zstd/lib/legacy/zstd_v03.c +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/zstd/lib/legacy/zstd_v03.h +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/zstd/lib/legacy/zstd_v04.c +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/zstd/lib/legacy/zstd_v04.h +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/zstd/lib/legacy/zstd_v05.c +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/zstd/lib/legacy/zstd_v05.h +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/zstd/lib/legacy/zstd_v06.c +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/zstd/lib/legacy/zstd_v06.h +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/zstd/lib/legacy/zstd_v07.c +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/zstd/lib/legacy/zstd_v07.h +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/zstd/lib/zstd.h +0 -0
- {zstd-1.5.6.1 → zstd-1.5.6.2}/zstd/lib/zstd_errors.h +0 -0
@@ -1,6 +1,6 @@
|
|
1
|
-
Metadata-Version: 2.
|
1
|
+
Metadata-Version: 2.2
|
2
2
|
Name: zstd
|
3
|
-
Version: 1.5.6.
|
3
|
+
Version: 1.5.6.2
|
4
4
|
Summary: ZSTD Bindings for Python
|
5
5
|
Home-page: https://github.com/sergey-dryabzhinsky/python-zstd
|
6
6
|
Author: Sergey Dryabzhinsky, Anton Stuk
|
@@ -24,13 +24,25 @@ Classifier: Programming Language :: Python :: 3.8
|
|
24
24
|
Classifier: Programming Language :: Python :: 3.9
|
25
25
|
Classifier: Programming Language :: Python :: 3.10
|
26
26
|
Classifier: Programming Language :: Python :: 3.11
|
27
|
+
Classifier: Programming Language :: Python :: 3.12
|
28
|
+
Classifier: Programming Language :: Python :: 3.13
|
27
29
|
License-File: LICENSE
|
28
|
-
|
29
|
-
|
30
|
+
Dynamic: author
|
31
|
+
Dynamic: author-email
|
32
|
+
Dynamic: classifier
|
33
|
+
Dynamic: description
|
34
|
+
Dynamic: home-page
|
35
|
+
Dynamic: keywords
|
36
|
+
Dynamic: license
|
37
|
+
Dynamic: maintainer
|
38
|
+
Dynamic: maintainer-email
|
39
|
+
Dynamic: summary
|
40
|
+
|
41
|
+
7=============
|
30
42
|
python-zstd
|
31
43
|
=============
|
32
44
|
|
33
|
-
.. |releaseW| image:: https://github.com/sergey-dryabzhinsky/python-zstd/actions/workflows/build-wheels.yml/badge.svg?branch=v1.5.6.
|
45
|
+
.. |releaseW| image:: https://github.com/sergey-dryabzhinsky/python-zstd/actions/workflows/build-wheels.yml/badge.svg?branch=v1.5.6.2
|
34
46
|
:target: https://github.com/sergey-dryabzhinsky/python-zstd/actions/workflows/build-wheels.yml
|
35
47
|
|
36
48
|
.. |masterW| image:: https://github.com/sergey-dryabzhinsky/python-zstd/actions/workflows/build-wheels.yml/badge.svg
|
@@ -116,10 +128,30 @@ To build with python-zstd legacy format support (pre 1.1.2) - pass ``--pyzstd-le
|
|
116
128
|
|
117
129
|
>>> $ python setup.py build_ext --pyzstd-legacy clean
|
118
130
|
|
119
|
-
If you want to build with existing distribution of libzstd just add ``--external`` option.
|
120
131
|
But beware! Legacy formats support state is unknown in this case.
|
121
132
|
And if your version not equal with python-zstd - tests may not pass.
|
122
133
|
|
134
|
+
If you're scared of threads you may pass option `--libzstd-no-threads`:
|
135
|
+
|
136
|
+
>>> $ python setup.py build_ext --libzstd-no-threads clean
|
137
|
+
|
138
|
+
When using a PEP 517 builder you can use ``ZSTD_THREADS`` environment variable instead:
|
139
|
+
|
140
|
+
>>> $ ZSTD_THREADS=0 python -m build -w
|
141
|
+
|
142
|
+
If you're meet some cpu instruction errorrs you may try to disable built-in optimizations and pass option `--libzstd-no-use-asm`:
|
143
|
+
|
144
|
+
>>> $ python setup.py build_ext --libzstd-no-use-asm clean
|
145
|
+
|
146
|
+
Or add more speed with option `--libzstd-use-asm-bmi2` to use instructions for new AMD CPU.
|
147
|
+
When using a PEP 517 builder you can use ``ZSTD_ASM`` environment variable instead:
|
148
|
+
And ``ZST_ASM_BMI2=1`` too for bmi2 use.
|
149
|
+
|
150
|
+
>>> $ ZSTD_ASM=0 python -m build -w
|
151
|
+
|
152
|
+
|
153
|
+
If you want to build with existing distribution of libzstd just add ``--external`` option
|
154
|
+
|
123
155
|
>>> $ python setup.py build_ext --external clean
|
124
156
|
|
125
157
|
When using a PEP 517 builder you can use ``ZSTD_EXTERNAL`` environment variable instead:
|
@@ -156,7 +188,10 @@ ZSTD_compress (data[, level, threads]): string|bytes
|
|
156
188
|
* **level**: int - compression level, ultra-fast levels from -100 (ultra) to -1 (fast) available since zstd-1.3.4, and from 1 (fast) to 22 (slowest), 0 or unset - means default (3). Default - 3.
|
157
189
|
* **threads**: int - how many threads to use, from 0 to 200, 0 or unset - auto-tune by cpu cores count. Default - 0. Since: 1.4.4.1
|
158
190
|
|
159
|
-
Aliases:
|
191
|
+
Aliases:
|
192
|
+
- *compress(...)*,
|
193
|
+
- *dumps(...)*,
|
194
|
+
- *encode(...)* since: 1.5.6.2
|
160
195
|
|
161
196
|
Exception if:
|
162
197
|
- level bigger than max level
|
@@ -164,7 +199,7 @@ ZSTD_compress (data[, level, threads]): string|bytes
|
|
164
199
|
Max number of threads:
|
165
200
|
- 32bit system: 64
|
166
201
|
- 64bit system: 256
|
167
|
-
If provided bigger number -
|
202
|
+
If provided bigger number - silently set maximber (since 1.5.4.1)
|
168
203
|
|
169
204
|
Since: 0.1
|
170
205
|
|
@@ -177,10 +212,28 @@ ZSTD_uncompress (data): string|bytes
|
|
177
212
|
|
178
213
|
* **data**: string|bytes - input compressed data block, length limited by 2Gb by Python API
|
179
214
|
|
180
|
-
Aliases:
|
215
|
+
Aliases:
|
216
|
+
- *decompress(...)*,
|
217
|
+
- *uncompress(...)*,
|
218
|
+
- *loads(...)*,
|
219
|
+
- *decode(...)* since: 1.5.6.2
|
181
220
|
|
182
221
|
Since: 0.1
|
183
222
|
|
223
|
+
ZSTD_check (data): string|bytes
|
224
|
+
Function, checks if input is zstd compressed data block, return s1if yes, 0 if no, or raises Error.
|
225
|
+
|
226
|
+
Support compressed data with multiple/concatenated frames (blocks) .
|
227
|
+
|
228
|
+
Params:
|
229
|
+
|
230
|
+
* **data**: string|bytes - input compressed data block, length limited by 2Gb by Python API
|
231
|
+
|
232
|
+
Aliases:
|
233
|
+
- *check(...)*,
|
234
|
+
|
235
|
+
Since: 1.5.6.2
|
236
|
+
|
184
237
|
version (): string|bytes
|
185
238
|
Returns this module doted version string.
|
186
239
|
|
@@ -214,6 +267,16 @@ ZSTD_external (): int
|
|
214
267
|
|
215
268
|
Since: 1.5.0.2
|
216
269
|
|
270
|
+
ZSTD_with_threads (): int
|
271
|
+
Returns 0 of 1 if bundled ZSTD library build with threads support.
|
272
|
+
|
273
|
+
Since: 1.5.6.2
|
274
|
+
|
275
|
+
ZSTD_with_asm (): int
|
276
|
+
Returns 0 of 1 if bundled ZSTD library build with asm optimization s.
|
277
|
+
|
278
|
+
Since: 1.5.6.2
|
279
|
+
|
217
280
|
|
218
281
|
Removed
|
219
282
|
_______
|
@@ -1,36 +1,8 @@
|
|
1
|
-
|
2
|
-
Name: zstd
|
3
|
-
Version: 1.5.6.1
|
4
|
-
Summary: ZSTD Bindings for Python
|
5
|
-
Home-page: https://github.com/sergey-dryabzhinsky/python-zstd
|
6
|
-
Author: Sergey Dryabzhinsky, Anton Stuk
|
7
|
-
Author-email: sergey.dryabzhinsky@gmail.com
|
8
|
-
Maintainer: Sergey Dryabzhinsky
|
9
|
-
Maintainer-email: sergey.dryabzhinsky@gmail.com
|
10
|
-
License: BSD
|
11
|
-
Keywords: zstd,zstandard,compression
|
12
|
-
Classifier: License :: OSI Approved :: BSD License
|
13
|
-
Classifier: Intended Audience :: Developers
|
14
|
-
Classifier: Development Status :: 5 - Production/Stable
|
15
|
-
Classifier: Operating System :: POSIX
|
16
|
-
Classifier: Programming Language :: C
|
17
|
-
Classifier: Programming Language :: Python
|
18
|
-
Classifier: Programming Language :: Python :: 2.7
|
19
|
-
Classifier: Programming Language :: Python :: 3.4
|
20
|
-
Classifier: Programming Language :: Python :: 3.5
|
21
|
-
Classifier: Programming Language :: Python :: 3.6
|
22
|
-
Classifier: Programming Language :: Python :: 3.7
|
23
|
-
Classifier: Programming Language :: Python :: 3.8
|
24
|
-
Classifier: Programming Language :: Python :: 3.9
|
25
|
-
Classifier: Programming Language :: Python :: 3.10
|
26
|
-
Classifier: Programming Language :: Python :: 3.11
|
27
|
-
License-File: LICENSE
|
28
|
-
|
29
|
-
=============
|
1
|
+
7=============
|
30
2
|
python-zstd
|
31
3
|
=============
|
32
4
|
|
33
|
-
.. |releaseW| image:: https://github.com/sergey-dryabzhinsky/python-zstd/actions/workflows/build-wheels.yml/badge.svg?branch=v1.5.6.
|
5
|
+
.. |releaseW| image:: https://github.com/sergey-dryabzhinsky/python-zstd/actions/workflows/build-wheels.yml/badge.svg?branch=v1.5.6.2
|
34
6
|
:target: https://github.com/sergey-dryabzhinsky/python-zstd/actions/workflows/build-wheels.yml
|
35
7
|
|
36
8
|
.. |masterW| image:: https://github.com/sergey-dryabzhinsky/python-zstd/actions/workflows/build-wheels.yml/badge.svg
|
@@ -116,10 +88,30 @@ To build with python-zstd legacy format support (pre 1.1.2) - pass ``--pyzstd-le
|
|
116
88
|
|
117
89
|
>>> $ python setup.py build_ext --pyzstd-legacy clean
|
118
90
|
|
119
|
-
If you want to build with existing distribution of libzstd just add ``--external`` option.
|
120
91
|
But beware! Legacy formats support state is unknown in this case.
|
121
92
|
And if your version not equal with python-zstd - tests may not pass.
|
122
93
|
|
94
|
+
If you're scared of threads you may pass option `--libzstd-no-threads`:
|
95
|
+
|
96
|
+
>>> $ python setup.py build_ext --libzstd-no-threads clean
|
97
|
+
|
98
|
+
When using a PEP 517 builder you can use ``ZSTD_THREADS`` environment variable instead:
|
99
|
+
|
100
|
+
>>> $ ZSTD_THREADS=0 python -m build -w
|
101
|
+
|
102
|
+
If you're meet some cpu instruction errorrs you may try to disable built-in optimizations and pass option `--libzstd-no-use-asm`:
|
103
|
+
|
104
|
+
>>> $ python setup.py build_ext --libzstd-no-use-asm clean
|
105
|
+
|
106
|
+
Or add more speed with option `--libzstd-use-asm-bmi2` to use instructions for new AMD CPU.
|
107
|
+
When using a PEP 517 builder you can use ``ZSTD_ASM`` environment variable instead:
|
108
|
+
And ``ZST_ASM_BMI2=1`` too for bmi2 use.
|
109
|
+
|
110
|
+
>>> $ ZSTD_ASM=0 python -m build -w
|
111
|
+
|
112
|
+
|
113
|
+
If you want to build with existing distribution of libzstd just add ``--external`` option
|
114
|
+
|
123
115
|
>>> $ python setup.py build_ext --external clean
|
124
116
|
|
125
117
|
When using a PEP 517 builder you can use ``ZSTD_EXTERNAL`` environment variable instead:
|
@@ -156,7 +148,10 @@ ZSTD_compress (data[, level, threads]): string|bytes
|
|
156
148
|
* **level**: int - compression level, ultra-fast levels from -100 (ultra) to -1 (fast) available since zstd-1.3.4, and from 1 (fast) to 22 (slowest), 0 or unset - means default (3). Default - 3.
|
157
149
|
* **threads**: int - how many threads to use, from 0 to 200, 0 or unset - auto-tune by cpu cores count. Default - 0. Since: 1.4.4.1
|
158
150
|
|
159
|
-
Aliases:
|
151
|
+
Aliases:
|
152
|
+
- *compress(...)*,
|
153
|
+
- *dumps(...)*,
|
154
|
+
- *encode(...)* since: 1.5.6.2
|
160
155
|
|
161
156
|
Exception if:
|
162
157
|
- level bigger than max level
|
@@ -164,7 +159,7 @@ ZSTD_compress (data[, level, threads]): string|bytes
|
|
164
159
|
Max number of threads:
|
165
160
|
- 32bit system: 64
|
166
161
|
- 64bit system: 256
|
167
|
-
If provided bigger number -
|
162
|
+
If provided bigger number - silently set maximber (since 1.5.4.1)
|
168
163
|
|
169
164
|
Since: 0.1
|
170
165
|
|
@@ -177,10 +172,28 @@ ZSTD_uncompress (data): string|bytes
|
|
177
172
|
|
178
173
|
* **data**: string|bytes - input compressed data block, length limited by 2Gb by Python API
|
179
174
|
|
180
|
-
Aliases:
|
175
|
+
Aliases:
|
176
|
+
- *decompress(...)*,
|
177
|
+
- *uncompress(...)*,
|
178
|
+
- *loads(...)*,
|
179
|
+
- *decode(...)* since: 1.5.6.2
|
181
180
|
|
182
181
|
Since: 0.1
|
183
182
|
|
183
|
+
ZSTD_check (data): string|bytes
|
184
|
+
Function, checks if input is zstd compressed data block, return s1if yes, 0 if no, or raises Error.
|
185
|
+
|
186
|
+
Support compressed data with multiple/concatenated frames (blocks) .
|
187
|
+
|
188
|
+
Params:
|
189
|
+
|
190
|
+
* **data**: string|bytes - input compressed data block, length limited by 2Gb by Python API
|
191
|
+
|
192
|
+
Aliases:
|
193
|
+
- *check(...)*,
|
194
|
+
|
195
|
+
Since: 1.5.6.2
|
196
|
+
|
184
197
|
version (): string|bytes
|
185
198
|
Returns this module doted version string.
|
186
199
|
|
@@ -214,6 +227,16 @@ ZSTD_external (): int
|
|
214
227
|
|
215
228
|
Since: 1.5.0.2
|
216
229
|
|
230
|
+
ZSTD_with_threads (): int
|
231
|
+
Returns 0 of 1 if bundled ZSTD library build with threads support.
|
232
|
+
|
233
|
+
Since: 1.5.6.2
|
234
|
+
|
235
|
+
ZSTD_with_asm (): int
|
236
|
+
Returns 0 of 1 if bundled ZSTD library build with asm optimization s.
|
237
|
+
|
238
|
+
Since: 1.5.6.2
|
239
|
+
|
217
240
|
|
218
241
|
Removed
|
219
242
|
_______
|
@@ -14,7 +14,7 @@ VERSION_STR = ".".join([str(x) for x in VERSION])
|
|
14
14
|
# Package version
|
15
15
|
PKG_VERSION = VERSION
|
16
16
|
# Minor versions
|
17
|
-
PKG_VERSION += ("
|
17
|
+
PKG_VERSION += ("2",)
|
18
18
|
PKG_VERSION_STR = ".".join([str(x) for x in PKG_VERSION])
|
19
19
|
|
20
20
|
###
|
@@ -27,6 +27,35 @@ if "--legacy" in sys.argv:
|
|
27
27
|
SUP_LEGACY=True
|
28
28
|
sys.argv.remove("--legacy")
|
29
29
|
|
30
|
+
SUP_ASM="ZSTD_ASM" in os.environ or True
|
31
|
+
#a asm on by default
|
32
|
+
if "--libzstd-no-use-asm" in sys.argv:
|
33
|
+
# Support assembler builtin optimization in lizstd
|
34
|
+
SUP_ASM=False
|
35
|
+
sys.argv.remove("--libzstd-no-use-asm")
|
36
|
+
DISABLE_ASM=1
|
37
|
+
if SUP_ASM:
|
38
|
+
DISABLE_ASM=0
|
39
|
+
|
40
|
+
SUP_THREADS="ZSTD_THREADS" in os.environ or True
|
41
|
+
# threads on by default
|
42
|
+
if "--libzstd-no-threads" in sys.argv:
|
43
|
+
# Disable support multithreading in lizstd
|
44
|
+
SUP_THREADS=False
|
45
|
+
sys.argv.remove("--libzstd-no-threads")
|
46
|
+
ENABLE_THREADS=0
|
47
|
+
if SUP_THREADS:
|
48
|
+
ENABLE_THREADS=1
|
49
|
+
|
50
|
+
SUP_ASM_BMI2="ZSTD_ASM_BMI2" in os.environ
|
51
|
+
if "--libzstd-use-asm-bmi2" in sys.argv:
|
52
|
+
# Support assembler builtin optimization in lizstd for new AMD CPU
|
53
|
+
SUP_ASM_BMI2=True
|
54
|
+
sys.argv.remove("--libzstd-use-asm-bmi2")
|
55
|
+
ENABLE_ASM_BMI2=0
|
56
|
+
if SUP_ASM_BMI2:
|
57
|
+
ENABLE_ASM_BMI2=1
|
58
|
+
|
30
59
|
SUP_TRACE="ZSTD_TRACE" in os.environ
|
31
60
|
if "--debug-trace" in sys.argv:
|
32
61
|
# Support tracing for debug
|
@@ -68,21 +97,21 @@ if SUP_EXTERNAL:
|
|
68
97
|
# DZSTD_DISABLE_ASM=1 - disable ASM inlines, pypi/pip can't build them
|
69
98
|
#
|
70
99
|
COPT = {
|
71
|
-
'msvc': [ '/Ox', '/DVERSION=%s' % PKG_VERSION_STR, '/DDYNAMIC_BMI2
|
72
|
-
'mingw32': [ '-O2', '-DVERSION=%s' % PKG_VERSION_STR, '-DDYNAMIC_BMI2
|
73
|
-
'unix': [ '-O2', '-DVERSION=%s' % PKG_VERSION_STR, '-DDYNAMIC_BMI2
|
74
|
-
'clang': [ '-O2', '-DVERSION=%s' % PKG_VERSION_STR, '-DDYNAMIC_BMI2
|
75
|
-
'gcc': [ '-O2', '-DVERSION=%s' % PKG_VERSION_STR, '-DDYNAMIC_BMI2
|
100
|
+
'msvc': [ '/Ox', '/DVERSION=%s' % PKG_VERSION_STR, '/DDYNAMIC_BMI2=%d' % ENABLE_ASM_BMI2, '/DZSTD_DISABLE_ASM=%d' % DISABLE_ASM ],
|
101
|
+
'mingw32': [ '-O2', '-DVERSION=%s' % PKG_VERSION_STR, '-DDYNAMIC_BMI2=%d' % ENABLE_ASM_BMI2, '-DZSTD_DISABLE_ASM=%d' % DISABLE_ASM ],
|
102
|
+
'unix': [ '-O2', '-DVERSION=%s' % PKG_VERSION_STR, '-DDYNAMIC_BMI2=%d' % ENABLE_ASM_BMI2, '-DZSTD_DISABLE_ASM=%d' % DISABLE_ASM ],
|
103
|
+
'clang': [ '-O2', '-DVERSION=%s' % PKG_VERSION_STR, '-DDYNAMIC_BMI2=%d' % ENABLE_ASM_BMI2, '-DZSTD_DISABLE_ASM=%d' % DISABLE_ASM ],
|
104
|
+
'gcc': [ '-O2', '-DVERSION=%s' % PKG_VERSION_STR, '-DDYNAMIC_BMI2=%d' % ENABLE_ASM_BMI2, '-DZSTD_DISABLE_ASM=%d' % DISABLE_ASM ]
|
76
105
|
}
|
77
106
|
|
78
107
|
if not SUP_EXTERNAL:
|
79
108
|
for comp in COPT:
|
80
109
|
if comp == 'msvc':
|
81
|
-
COPT[comp].extend([ '/DZSTD_MULTITHREAD
|
110
|
+
COPT[comp].extend([ '/DZSTD_MULTITHREAD=%d' % ENABLE_THREADS,
|
82
111
|
'/Izstd\\lib', '/Izstd\\lib\\common', '/Izstd\\lib\\compress', '/Izstd\\lib\\decompress',
|
83
112
|
])
|
84
113
|
else:
|
85
|
-
COPT[comp].extend([ '-DZSTD_MULTITHREAD
|
114
|
+
COPT[comp].extend([ '-DZSTD_MULTITHREAD=%d' % ENABLE_THREADS,
|
86
115
|
'-Izstd/lib', '-Izstd/lib/common', '-Izstd/lib/compress', '-Izstd/lib/decompress',
|
87
116
|
])
|
88
117
|
else:
|
@@ -218,5 +247,7 @@ setup(
|
|
218
247
|
'Programming Language :: Python :: 3.9',
|
219
248
|
'Programming Language :: Python :: 3.10',
|
220
249
|
'Programming Language :: Python :: 3.11',
|
250
|
+
'Programming Language :: Python :: 3.12',
|
251
|
+
'Programming Language :: Python :: 3.13',
|
221
252
|
]
|
222
253
|
)
|
@@ -196,6 +196,8 @@ static PyObject *py_zstd_uncompress(PyObject* self, PyObject *args)
|
|
196
196
|
PyErr_Format(ZstdError, "Decompression error: length mismatch -> decomp %lu != %lu [header]", (uint64_t)cSize, dest_size);
|
197
197
|
error = 1;
|
198
198
|
}
|
199
|
+
} else {
|
200
|
+
error = 1;
|
199
201
|
}
|
200
202
|
|
201
203
|
if (error) {
|
@@ -210,6 +212,53 @@ static PyObject *py_zstd_uncompress(PyObject* self, PyObject *args)
|
|
210
212
|
return result;
|
211
213
|
}
|
212
214
|
|
215
|
+
/**
|
216
|
+
* New more interoperable function
|
217
|
+
* Uses origin zstd header, nothing more
|
218
|
+
* Simple version: check if data block has zstd compressed data inside
|
219
|
+
*/
|
220
|
+
static PyObject *py_zstd_check(PyObject* self, PyObject *args)
|
221
|
+
{
|
222
|
+
//PyObject *result;
|
223
|
+
const char *source, *src;
|
224
|
+
Py_ssize_t source_size, ss, seek_frame;
|
225
|
+
uint64_t dest_size, frame_size;
|
226
|
+
//char error = 0;
|
227
|
+
//size_t cSize;
|
228
|
+
|
229
|
+
#if PY_MAJOR_VERSION >= 3
|
230
|
+
if (!PyArg_ParseTuple(args, "y#", &source, &source_size))
|
231
|
+
return NULL;
|
232
|
+
#else
|
233
|
+
if (!PyArg_ParseTuple(args, "s#", &source, &source_size))
|
234
|
+
return NULL;
|
235
|
+
#endif
|
236
|
+
|
237
|
+
dest_size = (uint64_t) ZSTD_getFrameContentSize(source, source_size);
|
238
|
+
if (dest_size == ZSTD_CONTENTSIZE_UNKNOWN || dest_size == ZSTD_CONTENTSIZE_ERROR) {
|
239
|
+
//PyErr_Format(ZstdError, "Input data invalid or missing content size in frame header.");
|
240
|
+
return Py_BuildValue("i", 0);
|
241
|
+
}
|
242
|
+
|
243
|
+
// Find real dest_size across multiple frames
|
244
|
+
ss = source_size;
|
245
|
+
seek_frame = ss - 1;
|
246
|
+
src = source;
|
247
|
+
while (seek_frame < ss) {
|
248
|
+
seek_frame = ZSTD_findFrameCompressedSize(src, ss);
|
249
|
+
if (ZSTD_isError(seek_frame)) break;
|
250
|
+
src += seek_frame;
|
251
|
+
ss -= seek_frame;
|
252
|
+
if (ss <=0) break;
|
253
|
+
frame_size = (uint64_t) ZSTD_getFrameContentSize(src, ss);
|
254
|
+
if (ZSTD_isError(frame_size)) break;
|
255
|
+
dest_size += frame_size;
|
256
|
+
}
|
257
|
+
if (dest_size>=source_size)
|
258
|
+
Py_BuildValue("i", 0);
|
259
|
+
return Py_BuildValue("i", 1);
|
260
|
+
}
|
261
|
+
|
213
262
|
/**
|
214
263
|
* Returns this module version as string
|
215
264
|
*/
|
@@ -251,6 +300,25 @@ static PyObject *py_zstd_library_external(PyObject* self, PyObject *args)
|
|
251
300
|
}
|
252
301
|
|
253
302
|
|
303
|
+
/**
|
304
|
+
* Returns 0 or 1 if ZSTD library build with threads
|
305
|
+
*/
|
306
|
+
static PyObject *py_zstd_with_threads(PyObject* self, PyObject *args)
|
307
|
+
{
|
308
|
+
return Py_BuildValue("i", ZSTD_MULTITHREAD);
|
309
|
+
}
|
310
|
+
|
311
|
+
|
312
|
+
/**
|
313
|
+
* Returns 0 or 1 if ZSTD library build with threads
|
314
|
+
*/
|
315
|
+
static PyObject *py_zstd_with_asm(PyObject* self, PyObject *args)
|
316
|
+
{
|
317
|
+
return Py_BuildValue("i", ! ZSTD_DISABLE_ASM);
|
318
|
+
}
|
319
|
+
|
320
|
+
|
321
|
+
|
254
322
|
/**
|
255
323
|
* Returns ZSTD determined threads count, int
|
256
324
|
*/
|
@@ -273,8 +341,12 @@ static PyObject *py_zstd_max_threads_count(PyObject* self, PyObject *args)
|
|
273
341
|
static PyMethodDef ZstdMethods[] = {
|
274
342
|
{"ZSTD_compress", py_zstd_compress_mt, METH_VARARGS, COMPRESS_DOCSTRING},
|
275
343
|
{"ZSTD_uncompress", py_zstd_uncompress, METH_VARARGS, UNCOMPRESS_DOCSTRING},
|
344
|
+
{"ZSTD_check", py_zstd_check, METH_VARARGS, CHECK_DOCSTRING},
|
345
|
+
{"check", py_zstd_check, METH_VARARGS, CHECK_DOCSTRING},
|
276
346
|
{"compress", py_zstd_compress_mt, METH_VARARGS, COMPRESS_DOCSTRING},
|
277
347
|
{"uncompress", py_zstd_uncompress, METH_VARARGS, UNCOMPRESS_DOCSTRING},
|
348
|
+
{"encode", py_zstd_compress_mt, METH_VARARGS, COMPRESS_DOCSTRING},
|
349
|
+
{"decode", py_zstd_uncompress, METH_VARARGS, UNCOMPRESS_DOCSTRING},
|
278
350
|
{"decompress", py_zstd_uncompress, METH_VARARGS, UNCOMPRESS_DOCSTRING},
|
279
351
|
{"dumps", py_zstd_compress_mt, METH_VARARGS, COMPRESS_DOCSTRING},
|
280
352
|
{"loads", py_zstd_uncompress, METH_VARARGS, UNCOMPRESS_DOCSTRING},
|
@@ -284,6 +356,8 @@ static PyMethodDef ZstdMethods[] = {
|
|
284
356
|
{"ZSTD_threads_count", py_zstd_threads_count, METH_NOARGS, ZSTD_THREADS_COUNT_DOCSTRING},
|
285
357
|
{"ZSTD_max_threads_count", py_zstd_max_threads_count, METH_NOARGS, ZSTD_MAX_THREADS_COUNT_DOCSTRING},
|
286
358
|
{"ZSTD_external", py_zstd_library_external, METH_NOARGS, ZSTD_EXTERNAL_DOCSTRING},
|
359
|
+
{"ZSTD_with_threads", py_zstd_with_threads, METH_NOARGS, ZSTD_WITH_THREADS_DOCSTRING},
|
360
|
+
{"ZSTD_with_asm", py_zstd_with_asm, METH_NOARGS, ZSTD_WITH_ASM_DOCSTRING},
|
287
361
|
{NULL, NULL, 0, NULL}
|
288
362
|
};
|
289
363
|
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*
|
2
|
-
* Copyright (c) 2015-
|
2
|
+
* Copyright (c) 2015-2025 Sergey Dryabzhinsky
|
3
3
|
* All rights reserved.
|
4
4
|
*
|
5
5
|
* Redistribution and use in source and binary forms, with or without
|
@@ -80,10 +80,13 @@ static PyObject *ZstdError;
|
|
80
80
|
|
81
81
|
static PyObject *py_zstd_compress_mt(PyObject* self, PyObject *args);
|
82
82
|
static PyObject *py_zstd_uncompress(PyObject* self, PyObject *args);
|
83
|
+
static PyObject *py_zstd_check(PyObject* self, PyObject *args);
|
83
84
|
static PyObject *py_zstd_module_version(PyObject* self, PyObject *args);
|
84
85
|
static PyObject *py_zstd_library_version(PyObject* self, PyObject *args);
|
85
86
|
static PyObject *py_zstd_library_version_int(PyObject* self, PyObject *args);
|
86
87
|
static PyObject *py_zstd_library_external(PyObject* self, PyObject *args);
|
88
|
+
static PyObject *py_zstd_with_threads(PyObject* self, PyObject *args);
|
89
|
+
static PyObject *py_zstd_with_asm(PyObject* self, PyObject *args);
|
87
90
|
|
88
91
|
#if PY_MAJOR_VERSION < 3
|
89
92
|
PyMODINIT_FUNC initzstd(void);
|
@@ -104,10 +107,14 @@ Raises a zstd.Error exception if any error occurs."
|
|
104
107
|
|
105
108
|
#define UNCOMPRESS_DOCSTRING "decompress("PY_BYTESTR_TYPE"): string -- Returns uncompressed string.\n\nRaises a zstd.Error exception if any error occurs."
|
106
109
|
|
110
|
+
#define CHECK_DOCSTRING "check("PY_BYTESTR_TYPE"): string -- Returns 0 or 1.\n\nRaises a zstd.Error exception if any error occurs."
|
111
|
+
|
107
112
|
#define VERSION_DOCSTRING "version(): string -- Returns this module version as string."
|
108
113
|
#define ZSTD_VERSION_DOCSTRING "ZSTD_version(): string -- Returns ZSTD library version as string."
|
109
114
|
#define ZSTD_INT_VERSION_DOCSTRING "ZSTD_version_number(): int -- Returns ZSTD library version as integer.\n Format of the number is: major * 100*100 + minor * 100 + release."
|
110
115
|
#define ZSTD_EXTERNAL_DOCSTRING "ZSTD_external(): int -- Returns 0 or 1 if ZSTD library build as external."
|
116
|
+
#define ZSTD_WITH_THREADS_DOCSTRING "ZSTD_with_threads(): int -- Returns 0 or 1 if ZSTD library build with threads support."
|
117
|
+
#define ZSTD_WITH_ASM_DOCSTRING "ZSTD_with_asm(): int -- Returns 0 or 1 if ZSTD library build with assembler support."
|
111
118
|
#define ZSTD_THREADS_COUNT_DOCSTRING "ZSTD_threads_count(): int -- Returns ZSTD determined CPU cores count in integer."
|
112
119
|
#define ZSTD_MAX_THREADS_COUNT_DOCSTRING "ZSTD_max_threads_count(): int -- Returns ZSTD library determined maximum working threads count in integer."
|
113
120
|
|
@@ -1,8 +1,48 @@
|
|
1
|
-
|
1
|
+
Metadata-Version: 2.2
|
2
|
+
Name: zstd
|
3
|
+
Version: 1.5.6.2
|
4
|
+
Summary: ZSTD Bindings for Python
|
5
|
+
Home-page: https://github.com/sergey-dryabzhinsky/python-zstd
|
6
|
+
Author: Sergey Dryabzhinsky, Anton Stuk
|
7
|
+
Author-email: sergey.dryabzhinsky@gmail.com
|
8
|
+
Maintainer: Sergey Dryabzhinsky
|
9
|
+
Maintainer-email: sergey.dryabzhinsky@gmail.com
|
10
|
+
License: BSD
|
11
|
+
Keywords: zstd,zstandard,compression
|
12
|
+
Classifier: License :: OSI Approved :: BSD License
|
13
|
+
Classifier: Intended Audience :: Developers
|
14
|
+
Classifier: Development Status :: 5 - Production/Stable
|
15
|
+
Classifier: Operating System :: POSIX
|
16
|
+
Classifier: Programming Language :: C
|
17
|
+
Classifier: Programming Language :: Python
|
18
|
+
Classifier: Programming Language :: Python :: 2.7
|
19
|
+
Classifier: Programming Language :: Python :: 3.4
|
20
|
+
Classifier: Programming Language :: Python :: 3.5
|
21
|
+
Classifier: Programming Language :: Python :: 3.6
|
22
|
+
Classifier: Programming Language :: Python :: 3.7
|
23
|
+
Classifier: Programming Language :: Python :: 3.8
|
24
|
+
Classifier: Programming Language :: Python :: 3.9
|
25
|
+
Classifier: Programming Language :: Python :: 3.10
|
26
|
+
Classifier: Programming Language :: Python :: 3.11
|
27
|
+
Classifier: Programming Language :: Python :: 3.12
|
28
|
+
Classifier: Programming Language :: Python :: 3.13
|
29
|
+
License-File: LICENSE
|
30
|
+
Dynamic: author
|
31
|
+
Dynamic: author-email
|
32
|
+
Dynamic: classifier
|
33
|
+
Dynamic: description
|
34
|
+
Dynamic: home-page
|
35
|
+
Dynamic: keywords
|
36
|
+
Dynamic: license
|
37
|
+
Dynamic: maintainer
|
38
|
+
Dynamic: maintainer-email
|
39
|
+
Dynamic: summary
|
40
|
+
|
41
|
+
7=============
|
2
42
|
python-zstd
|
3
43
|
=============
|
4
44
|
|
5
|
-
.. |releaseW| image:: https://github.com/sergey-dryabzhinsky/python-zstd/actions/workflows/build-wheels.yml/badge.svg?branch=v1.5.6.
|
45
|
+
.. |releaseW| image:: https://github.com/sergey-dryabzhinsky/python-zstd/actions/workflows/build-wheels.yml/badge.svg?branch=v1.5.6.2
|
6
46
|
:target: https://github.com/sergey-dryabzhinsky/python-zstd/actions/workflows/build-wheels.yml
|
7
47
|
|
8
48
|
.. |masterW| image:: https://github.com/sergey-dryabzhinsky/python-zstd/actions/workflows/build-wheels.yml/badge.svg
|
@@ -88,10 +128,30 @@ To build with python-zstd legacy format support (pre 1.1.2) - pass ``--pyzstd-le
|
|
88
128
|
|
89
129
|
>>> $ python setup.py build_ext --pyzstd-legacy clean
|
90
130
|
|
91
|
-
If you want to build with existing distribution of libzstd just add ``--external`` option.
|
92
131
|
But beware! Legacy formats support state is unknown in this case.
|
93
132
|
And if your version not equal with python-zstd - tests may not pass.
|
94
133
|
|
134
|
+
If you're scared of threads you may pass option `--libzstd-no-threads`:
|
135
|
+
|
136
|
+
>>> $ python setup.py build_ext --libzstd-no-threads clean
|
137
|
+
|
138
|
+
When using a PEP 517 builder you can use ``ZSTD_THREADS`` environment variable instead:
|
139
|
+
|
140
|
+
>>> $ ZSTD_THREADS=0 python -m build -w
|
141
|
+
|
142
|
+
If you're meet some cpu instruction errorrs you may try to disable built-in optimizations and pass option `--libzstd-no-use-asm`:
|
143
|
+
|
144
|
+
>>> $ python setup.py build_ext --libzstd-no-use-asm clean
|
145
|
+
|
146
|
+
Or add more speed with option `--libzstd-use-asm-bmi2` to use instructions for new AMD CPU.
|
147
|
+
When using a PEP 517 builder you can use ``ZSTD_ASM`` environment variable instead:
|
148
|
+
And ``ZST_ASM_BMI2=1`` too for bmi2 use.
|
149
|
+
|
150
|
+
>>> $ ZSTD_ASM=0 python -m build -w
|
151
|
+
|
152
|
+
|
153
|
+
If you want to build with existing distribution of libzstd just add ``--external`` option
|
154
|
+
|
95
155
|
>>> $ python setup.py build_ext --external clean
|
96
156
|
|
97
157
|
When using a PEP 517 builder you can use ``ZSTD_EXTERNAL`` environment variable instead:
|
@@ -128,7 +188,10 @@ ZSTD_compress (data[, level, threads]): string|bytes
|
|
128
188
|
* **level**: int - compression level, ultra-fast levels from -100 (ultra) to -1 (fast) available since zstd-1.3.4, and from 1 (fast) to 22 (slowest), 0 or unset - means default (3). Default - 3.
|
129
189
|
* **threads**: int - how many threads to use, from 0 to 200, 0 or unset - auto-tune by cpu cores count. Default - 0. Since: 1.4.4.1
|
130
190
|
|
131
|
-
Aliases:
|
191
|
+
Aliases:
|
192
|
+
- *compress(...)*,
|
193
|
+
- *dumps(...)*,
|
194
|
+
- *encode(...)* since: 1.5.6.2
|
132
195
|
|
133
196
|
Exception if:
|
134
197
|
- level bigger than max level
|
@@ -136,7 +199,7 @@ ZSTD_compress (data[, level, threads]): string|bytes
|
|
136
199
|
Max number of threads:
|
137
200
|
- 32bit system: 64
|
138
201
|
- 64bit system: 256
|
139
|
-
If provided bigger number -
|
202
|
+
If provided bigger number - silently set maximber (since 1.5.4.1)
|
140
203
|
|
141
204
|
Since: 0.1
|
142
205
|
|
@@ -149,10 +212,28 @@ ZSTD_uncompress (data): string|bytes
|
|
149
212
|
|
150
213
|
* **data**: string|bytes - input compressed data block, length limited by 2Gb by Python API
|
151
214
|
|
152
|
-
Aliases:
|
215
|
+
Aliases:
|
216
|
+
- *decompress(...)*,
|
217
|
+
- *uncompress(...)*,
|
218
|
+
- *loads(...)*,
|
219
|
+
- *decode(...)* since: 1.5.6.2
|
153
220
|
|
154
221
|
Since: 0.1
|
155
222
|
|
223
|
+
ZSTD_check (data): string|bytes
|
224
|
+
Function, checks if input is zstd compressed data block, return s1if yes, 0 if no, or raises Error.
|
225
|
+
|
226
|
+
Support compressed data with multiple/concatenated frames (blocks) .
|
227
|
+
|
228
|
+
Params:
|
229
|
+
|
230
|
+
* **data**: string|bytes - input compressed data block, length limited by 2Gb by Python API
|
231
|
+
|
232
|
+
Aliases:
|
233
|
+
- *check(...)*,
|
234
|
+
|
235
|
+
Since: 1.5.6.2
|
236
|
+
|
156
237
|
version (): string|bytes
|
157
238
|
Returns this module doted version string.
|
158
239
|
|
@@ -186,6 +267,16 @@ ZSTD_external (): int
|
|
186
267
|
|
187
268
|
Since: 1.5.0.2
|
188
269
|
|
270
|
+
ZSTD_with_threads (): int
|
271
|
+
Returns 0 of 1 if bundled ZSTD library build with threads support.
|
272
|
+
|
273
|
+
Since: 1.5.6.2
|
274
|
+
|
275
|
+
ZSTD_with_asm (): int
|
276
|
+
Returns 0 of 1 if bundled ZSTD library build with asm optimization s.
|
277
|
+
|
278
|
+
Since: 1.5.6.2
|
279
|
+
|
189
280
|
|
190
281
|
Removed
|
191
282
|
_______
|
@@ -43,7 +43,7 @@ class BaseTestZSTD(unittest.TestCase):
|
|
43
43
|
VERSION = "1.5.6"
|
44
44
|
VERSION_INT = 10506
|
45
45
|
VERSION_INT_MIN = 1 * 100*100 + 0 * 1*100 + 0
|
46
|
-
PKG_VERSION = "1.5.6.
|
46
|
+
PKG_VERSION = "1.5.6.2"
|
47
47
|
|
48
48
|
def helper_version(self):
|
49
49
|
self.assertEqual(self.PKG_VERSION, zstd.version())
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# Tests
|
2
|
+
|
3
|
+
import sys
|
4
|
+
from tests.base import BaseTestZSTD, zstd, tDATA, log
|
5
|
+
|
6
|
+
class TestZstdDecompress(BaseTestZSTD):
|
7
|
+
|
8
|
+
def test_decompression_null(self):
|
9
|
+
if sys.hexversion < 0x03000000:
|
10
|
+
DATA = ''
|
11
|
+
else:
|
12
|
+
DATA =b''
|
13
|
+
self.assertRaises(zstd.Error, zstd.uncompress, zstd.compress(DATA)+b' ')
|
14
|
+
|
15
|
+
def test_check_compressed(self):
|
16
|
+
cdata = zstd.compress(tDATA)
|
17
|
+
log.info("zstd compressed data check:%r" % zstd.check(cdata))
|
18
|
+
self.assertEqual(1, zstd.check(cdata))
|
19
|
+
|
20
|
+
def test_check_uncompressed(self):
|
21
|
+
cdata = b''
|
22
|
+
log.info("zstd uncompressed data check:%r" % zstd.check(cdata))
|
23
|
+
self.assertEqual(0, zstd.check(cdata))
|
24
|
+
|
@@ -0,0 +1,52 @@
|
|
1
|
+
# Tests
|
2
|
+
|
3
|
+
from tests.base import BaseTestZSTD,tDATA,log,zstd
|
4
|
+
from time import time
|
5
|
+
|
6
|
+
class TestZstdSpeed(BaseTestZSTD):
|
7
|
+
|
8
|
+
def test_00_system_info(self):
|
9
|
+
log.info("Bundled libzstd uses assembler? : %r" % zstd.ZSTD_with_asm())
|
10
|
+
log.info("Bundled libzstd uses threads? :%r" % zstd.ZSTD_with_threads())
|
11
|
+
|
12
|
+
def test_compression_speed(self):
|
13
|
+
log.info("\nWait 60 seconds...")
|
14
|
+
sec = 60
|
15
|
+
sum = 0
|
16
|
+
l=len(tDATA)
|
17
|
+
tbegin = time()
|
18
|
+
while time()-tbegin<sec:
|
19
|
+
cdata = zstd.compress(tDATA)
|
20
|
+
sum+=l
|
21
|
+
|
22
|
+
log.info("Compression speed average =%6f Mb/sec" % (1.0*sum/1024/1024/sec,))
|
23
|
+
|
24
|
+
def test_decompression_speed(self):
|
25
|
+
log.info("\nWait 60 seconds...")
|
26
|
+
sec = 60
|
27
|
+
sum = 0
|
28
|
+
cdata = zstd.compress(tDATA)
|
29
|
+
l=len(cdata)
|
30
|
+
tbegin = time()
|
31
|
+
while time()-tbegin<sec:
|
32
|
+
data = zstd.decompress(cdata)
|
33
|
+
sum+=l
|
34
|
+
|
35
|
+
log.info("Decompression speed average =%6f Mb/sec" % (1.0*sum/1024/1024/sec,))
|
36
|
+
|
37
|
+
def test_check_speed(self):
|
38
|
+
log.info("\nWait 60 seconds...")
|
39
|
+
sec = 60
|
40
|
+
sum = 0
|
41
|
+
cdata = zstd.compress(tDATA)
|
42
|
+
l=len(cdata)
|
43
|
+
tbegin = time()
|
44
|
+
while time()-tbegin<sec:
|
45
|
+
data = zstd.check(cdata)
|
46
|
+
sum+=l
|
47
|
+
|
48
|
+
log.info("Check speed average =%6f Mb/sec" % (1.0*sum/1024/1024/sec,))
|
49
|
+
|
50
|
+
if __name__ == '__main__':
|
51
|
+
unittest.main()
|
52
|
+
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|