kanzi 0.2.2__tar.gz

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 (43) hide show
  1. kanzi-0.2.2/Cargo.lock +252 -0
  2. kanzi-0.2.2/Cargo.toml +6 -0
  3. kanzi-0.2.2/LICENSE +201 -0
  4. kanzi-0.2.2/PKG-INFO +157 -0
  5. kanzi-0.2.2/README.md +129 -0
  6. kanzi-0.2.2/crates/kanzi/Cargo.toml +25 -0
  7. kanzi-0.2.2/crates/kanzi/src/alias.rs +464 -0
  8. kanzi-0.2.2/crates/kanzi/src/ans.rs +1147 -0
  9. kanzi-0.2.2/crates/kanzi/src/binary_entropy.rs +327 -0
  10. kanzi-0.2.2/crates/kanzi/src/bitio.rs +366 -0
  11. kanzi-0.2.2/crates/kanzi/src/bwt.rs +1725 -0
  12. kanzi-0.2.2/crates/kanzi/src/cm.rs +136 -0
  13. kanzi-0.2.2/crates/kanzi/src/container.rs +3429 -0
  14. kanzi-0.2.2/crates/kanzi/src/datatype.rs +81 -0
  15. kanzi-0.2.2/crates/kanzi/src/divsufsort.rs +3122 -0
  16. kanzi-0.2.2/crates/kanzi/src/exe.rs +1170 -0
  17. kanzi-0.2.2/crates/kanzi/src/fpaq.rs +351 -0
  18. kanzi-0.2.2/crates/kanzi/src/fsd.rs +354 -0
  19. kanzi-0.2.2/crates/kanzi/src/huffman_dec.rs +508 -0
  20. kanzi-0.2.2/crates/kanzi/src/huffman_enc.rs +638 -0
  21. kanzi-0.2.2/crates/kanzi/src/lib.rs +121 -0
  22. kanzi-0.2.2/crates/kanzi/src/logtables.rs +37 -0
  23. kanzi-0.2.2/crates/kanzi/src/lzp.rs +280 -0
  24. kanzi-0.2.2/crates/kanzi/src/lzx.rs +820 -0
  25. kanzi-0.2.2/crates/kanzi/src/magic.rs +98 -0
  26. kanzi-0.2.2/crates/kanzi/src/rlt.rs +430 -0
  27. kanzi-0.2.2/crates/kanzi/src/rolz.rs +977 -0
  28. kanzi-0.2.2/crates/kanzi/src/sais.rs +360 -0
  29. kanzi-0.2.2/crates/kanzi/src/sbrt.rs +165 -0
  30. kanzi-0.2.2/crates/kanzi/src/srt.rs +444 -0
  31. kanzi-0.2.2/crates/kanzi/src/tc_dict_en_1024.txt +1 -0
  32. kanzi-0.2.2/crates/kanzi/src/text_codec.rs +1004 -0
  33. kanzi-0.2.2/crates/kanzi/src/text_codec1.rs +608 -0
  34. kanzi-0.2.2/crates/kanzi/src/tpaq.rs +541 -0
  35. kanzi-0.2.2/crates/kanzi/src/tpaq_tables.rs +99 -0
  36. kanzi-0.2.2/crates/kanzi/src/utf.rs +538 -0
  37. kanzi-0.2.2/crates/kanzi/src/xxhash.rs +182 -0
  38. kanzi-0.2.2/crates/kanzi/src/zrlt.rs +231 -0
  39. kanzi-0.2.2/crates/kanzi-py/Cargo.toml +23 -0
  40. kanzi-0.2.2/crates/kanzi-py/build.rs +10 -0
  41. kanzi-0.2.2/crates/kanzi-py/examples/benchmark.py +143 -0
  42. kanzi-0.2.2/crates/kanzi-py/src/lib.rs +97 -0
  43. kanzi-0.2.2/pyproject.toml +48 -0
kanzi-0.2.2/Cargo.lock ADDED
@@ -0,0 +1,252 @@
1
+ # This file is automatically @generated by Cargo.
2
+ # It is not intended for manual editing.
3
+ version = 4
4
+
5
+ [[package]]
6
+ name = "autocfg"
7
+ version = "1.5.1"
8
+ source = "registry+https://github.com/rust-lang/crates.io-index"
9
+ checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53"
10
+
11
+ [[package]]
12
+ name = "bytemuck"
13
+ version = "1.25.2"
14
+ source = "registry+https://github.com/rust-lang/crates.io-index"
15
+ checksum = "95832e849adfb21180ccb6826a99da14e5d266ae5c2e668e1602cf234f153797"
16
+
17
+ [[package]]
18
+ name = "cc"
19
+ version = "1.4.5"
20
+ source = "registry+https://github.com/rust-lang/crates.io-index"
21
+ checksum = "005ec2760ca554fae18df7a11195552ec576cd665632a881bc011d5bb2fd4d80"
22
+ dependencies = [
23
+ "find-msvc-tools",
24
+ "shlex",
25
+ ]
26
+
27
+ [[package]]
28
+ name = "either"
29
+ version = "1.18.0"
30
+ source = "registry+https://github.com/rust-lang/crates.io-index"
31
+ checksum = "252afb9ae5eaa683babdc6a068b3f5726eb19e05070c731f9b2a23a7c3e8ed34"
32
+
33
+ [[package]]
34
+ name = "find-msvc-tools"
35
+ version = "0.1.12"
36
+ source = "registry+https://github.com/rust-lang/crates.io-index"
37
+ checksum = "3e0f1c7c3a72c66fd80abe965175f7523475c0489a87d3ff9d6e8c87d87a9d2d"
38
+
39
+ [[package]]
40
+ name = "heck"
41
+ version = "0.5.0"
42
+ source = "registry+https://github.com/rust-lang/crates.io-index"
43
+ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
44
+
45
+ [[package]]
46
+ name = "indoc"
47
+ version = "2.0.7"
48
+ source = "registry+https://github.com/rust-lang/crates.io-index"
49
+ checksum = "79cf5c93f93228cf8efb3ba362535fb11199ac548a09ce117c9b1adc3030d706"
50
+ dependencies = [
51
+ "rustversion",
52
+ ]
53
+
54
+ [[package]]
55
+ name = "kanzi"
56
+ version = "0.2.2"
57
+ dependencies = [
58
+ "libsais",
59
+ ]
60
+
61
+ [[package]]
62
+ name = "kanzi-cli"
63
+ version = "0.2.2"
64
+ dependencies = [
65
+ "kanzi",
66
+ ]
67
+
68
+ [[package]]
69
+ name = "kanzi-py"
70
+ version = "0.2.2"
71
+ dependencies = [
72
+ "kanzi",
73
+ "pyo3",
74
+ "pyo3-build-config",
75
+ ]
76
+
77
+ [[package]]
78
+ name = "libc"
79
+ version = "0.2.189"
80
+ source = "registry+https://github.com/rust-lang/crates.io-index"
81
+ checksum = "3eaf3ede3fee6db1a4c2ee091bf8a8b4dccdc6d17f656fb07896ee72867612f2"
82
+
83
+ [[package]]
84
+ name = "libsais"
85
+ version = "0.2.0"
86
+ source = "registry+https://github.com/rust-lang/crates.io-index"
87
+ checksum = "a739d1c7c4b375c59e25802b577f6d94b0101b77ce478cbcc8a36327957f583c"
88
+ dependencies = [
89
+ "bytemuck",
90
+ "either",
91
+ "libsais-sys",
92
+ "num-traits",
93
+ ]
94
+
95
+ [[package]]
96
+ name = "libsais-sys"
97
+ version = "0.2.0"
98
+ source = "registry+https://github.com/rust-lang/crates.io-index"
99
+ checksum = "4ec495a2918bacd868428951b45b9b3fb9464840e2ac559462c4370d6fa2c404"
100
+ dependencies = [
101
+ "cc",
102
+ ]
103
+
104
+ [[package]]
105
+ name = "memoffset"
106
+ version = "0.9.1"
107
+ source = "registry+https://github.com/rust-lang/crates.io-index"
108
+ checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a"
109
+ dependencies = [
110
+ "autocfg",
111
+ ]
112
+
113
+ [[package]]
114
+ name = "num-traits"
115
+ version = "0.2.19"
116
+ source = "registry+https://github.com/rust-lang/crates.io-index"
117
+ checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841"
118
+ dependencies = [
119
+ "autocfg",
120
+ ]
121
+
122
+ [[package]]
123
+ name = "once_cell"
124
+ version = "1.21.4"
125
+ source = "registry+https://github.com/rust-lang/crates.io-index"
126
+ checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50"
127
+
128
+ [[package]]
129
+ name = "portable-atomic"
130
+ version = "1.15.0"
131
+ source = "registry+https://github.com/rust-lang/crates.io-index"
132
+ checksum = "05c8b63e8d9609db387f0324918f81d68fe27748f084ef092fb35954d0539a85"
133
+
134
+ [[package]]
135
+ name = "proc-macro2"
136
+ version = "1.0.107"
137
+ source = "registry+https://github.com/rust-lang/crates.io-index"
138
+ checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9"
139
+ dependencies = [
140
+ "unicode-ident",
141
+ ]
142
+
143
+ [[package]]
144
+ name = "pyo3"
145
+ version = "0.26.0"
146
+ source = "registry+https://github.com/rust-lang/crates.io-index"
147
+ checksum = "7ba0117f4212101ee6544044dae45abe1083d30ce7b29c4b5cbdfa2354e07383"
148
+ dependencies = [
149
+ "indoc",
150
+ "libc",
151
+ "memoffset",
152
+ "once_cell",
153
+ "portable-atomic",
154
+ "pyo3-build-config",
155
+ "pyo3-ffi",
156
+ "pyo3-macros",
157
+ "unindent",
158
+ ]
159
+
160
+ [[package]]
161
+ name = "pyo3-build-config"
162
+ version = "0.26.0"
163
+ source = "registry+https://github.com/rust-lang/crates.io-index"
164
+ checksum = "4fc6ddaf24947d12a9aa31ac65431fb1b851b8f4365426e182901eabfb87df5f"
165
+ dependencies = [
166
+ "target-lexicon",
167
+ ]
168
+
169
+ [[package]]
170
+ name = "pyo3-ffi"
171
+ version = "0.26.0"
172
+ source = "registry+https://github.com/rust-lang/crates.io-index"
173
+ checksum = "025474d3928738efb38ac36d4744a74a400c901c7596199e20e45d98eb194105"
174
+ dependencies = [
175
+ "libc",
176
+ "pyo3-build-config",
177
+ ]
178
+
179
+ [[package]]
180
+ name = "pyo3-macros"
181
+ version = "0.26.0"
182
+ source = "registry+https://github.com/rust-lang/crates.io-index"
183
+ checksum = "2e64eb489f22fe1c95911b77c44cc41e7c19f3082fc81cce90f657cdc42ffded"
184
+ dependencies = [
185
+ "proc-macro2",
186
+ "pyo3-macros-backend",
187
+ "quote",
188
+ "syn",
189
+ ]
190
+
191
+ [[package]]
192
+ name = "pyo3-macros-backend"
193
+ version = "0.26.0"
194
+ source = "registry+https://github.com/rust-lang/crates.io-index"
195
+ checksum = "100246c0ecf400b475341b8455a9213344569af29a3c841d29270e53102e0fcf"
196
+ dependencies = [
197
+ "heck",
198
+ "proc-macro2",
199
+ "pyo3-build-config",
200
+ "quote",
201
+ "syn",
202
+ ]
203
+
204
+ [[package]]
205
+ name = "quote"
206
+ version = "1.0.47"
207
+ source = "registry+https://github.com/rust-lang/crates.io-index"
208
+ checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001"
209
+ dependencies = [
210
+ "proc-macro2",
211
+ ]
212
+
213
+ [[package]]
214
+ name = "rustversion"
215
+ version = "1.0.23"
216
+ source = "registry+https://github.com/rust-lang/crates.io-index"
217
+ checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f"
218
+
219
+ [[package]]
220
+ name = "shlex"
221
+ version = "2.0.1"
222
+ source = "registry+https://github.com/rust-lang/crates.io-index"
223
+ checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba"
224
+
225
+ [[package]]
226
+ name = "syn"
227
+ version = "2.0.119"
228
+ source = "registry+https://github.com/rust-lang/crates.io-index"
229
+ checksum = "872831b642d1a07999a962a351ed35b955ea2cfc8f3862091e2a240a84f17297"
230
+ dependencies = [
231
+ "proc-macro2",
232
+ "quote",
233
+ "unicode-ident",
234
+ ]
235
+
236
+ [[package]]
237
+ name = "target-lexicon"
238
+ version = "0.13.5"
239
+ source = "registry+https://github.com/rust-lang/crates.io-index"
240
+ checksum = "adb6935a6f5c20170eeceb1a3835a49e12e19d792f6dd344ccc76a985ca5a6ca"
241
+
242
+ [[package]]
243
+ name = "unicode-ident"
244
+ version = "1.0.24"
245
+ source = "registry+https://github.com/rust-lang/crates.io-index"
246
+ checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75"
247
+
248
+ [[package]]
249
+ name = "unindent"
250
+ version = "0.2.4"
251
+ source = "registry+https://github.com/rust-lang/crates.io-index"
252
+ checksum = "7264e107f553ccae879d21fbea1d6724ac785e8c3bfc762137959b5802826ef3"
kanzi-0.2.2/Cargo.toml ADDED
@@ -0,0 +1,6 @@
1
+ [workspace]
2
+ members = ["crates/kanzi", "crates/kanzi-py"]
3
+ resolver = "2"
4
+
5
+ [profile.release]
6
+ opt-level = 3
kanzi-0.2.2/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "{}"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2022 Frederic Langlet
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
kanzi-0.2.2/PKG-INFO ADDED
@@ -0,0 +1,157 @@
1
+ Metadata-Version: 2.4
2
+ Name: kanzi
3
+ Version: 0.2.2
4
+ Classifier: Development Status :: 4 - Beta
5
+ Classifier: Intended Audience :: Developers
6
+ Classifier: Programming Language :: Rust
7
+ Classifier: Programming Language :: Python :: 3
8
+ Classifier: Programming Language :: Python :: 3.9
9
+ Classifier: Programming Language :: Python :: 3.10
10
+ Classifier: Programming Language :: Python :: 3.11
11
+ Classifier: Programming Language :: Python :: 3.12
12
+ Classifier: Programming Language :: Python :: 3.13
13
+ Classifier: Programming Language :: Python :: Implementation :: CPython
14
+ Classifier: License :: OSI Approved :: Apache Software License
15
+ Classifier: Topic :: System :: Archiving :: Compression
16
+ Classifier: Operating System :: OS Independent
17
+ License-File: LICENSE
18
+ Summary: Rust port of the kanzi lossless data compressor, exposed as a Python extension module
19
+ Keywords: compression,lossless,kanzi,archiving
20
+ Author-email: ruslano69 <ruslano69@gmail.com>
21
+ License: Apache-2.0
22
+ Requires-Python: >=3.9
23
+ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
24
+ Project-URL: Homepage, https://github.com/ruslano69/kanzi-rs
25
+ Project-URL: Issues, https://github.com/ruslano69/kanzi-rs/issues
26
+ Project-URL: Repository, https://github.com/ruslano69/kanzi-rs
27
+
28
+ # kanzi-rs
29
+
30
+ A from-scratch Rust port of [Kanzi](https://github.com/flanglet/kanzi-go) — Frederic
31
+ Langlet's lossless data compressor — plus Python bindings (via [PyO3](https://pyo3.rs))
32
+ that expose it as a normal importable `kanzi` module.
33
+
34
+ This is an independent, unofficial project. It is not affiliated with or endorsed by
35
+ the kanzi-go project. See [Attribution & license](#attribution--license).
36
+
37
+ ## What's here
38
+
39
+ A Cargo workspace with three crates:
40
+
41
+ - `crates/kanzi` — the codec itself, pure Rust with no Python dependency: bitstream
42
+ I/O, the BWT/suffix array construction, LZ/LZX/ROLZ, RLT/ZRLT, rank/MTF transforms,
43
+ the TEXT/UTF/EXE/DNA filters, and the entropy coders (Huffman, ANS0, FPAQ, CM,
44
+ TPAQ/TPAQX) that back Kanzi's compression levels 0-9. `kanzi::compress` /
45
+ `kanzi::decompress` cover the whole container.
46
+ - `crates/kanzi-cli` — the `rust_kanzi` binary, for encoding/decoding files and
47
+ cross-checking the port against the real kanzi-go/kanzi-cpp binaries (see `verify/`).
48
+ - `crates/kanzi-py` — the PyO3 extension module (built as `kanzi` by
49
+ [maturin](https://www.maturin.rs/)), a thin wrapper over `crates/kanzi`.
50
+ - `crates/kanzi-py/examples/benchmark.py` — density/speed-by-level benchmark, run
51
+ against real files already in this repo rather than synthetic data (see below).
52
+
53
+ Plain `cargo build` / `cargo test` build and test only the pure-Rust crates; the
54
+ Python module is built by maturin.
55
+
56
+ ## Compression levels
57
+
58
+ Same level numbering and transform/entropy combinations as kanzi-go:
59
+
60
+ | Level | Transforms | Entropy |
61
+ |---|---|---|
62
+ | 0 | (store) | none |
63
+ | 1 | LZX | none |
64
+ | 2 | DNA+LZ | Huffman |
65
+ | 3 | TEXT+UTF+PACK+MM+LZX | Huffman |
66
+ | 4 | TEXT+UTF+EXE+PACK+MM+ROLZ | none |
67
+ | 5 | TEXT+UTF+BWT+RANK+ZRLT | ANS0 |
68
+ | 6 | TEXT+UTF+BWT+SRT+ZRLT | FPAQ |
69
+ | 7 | LZP+TEXT+UTF+BWT+LZP | CM |
70
+ | 8 | EXE+RLT+TEXT+UTF+DNA | TPAQ |
71
+ | 9 | EXE+RLT+TEXT+UTF+DNA | TPAQX |
72
+
73
+ Higher levels generally compress better at the cost of speed, but (as in kanzi-go)
74
+ this isn't guaranteed for every input — see `examples/benchmark.py`'s output.
75
+
76
+ ## Building the CLI
77
+
78
+ ```bash
79
+ cargo build --release
80
+ ./target/release/rust_kanzi encode8 input.bin output.knz
81
+ ./target/release/rust_kanzi decode output.knz restored.bin
82
+ ```
83
+
84
+ Suffix array construction uses [libsais](https://github.com/IlyaGrebnov/libsais) via
85
+ the default `fast-sa` feature, which needs a C compiler at build time. Without one,
86
+ build the pure-Rust fallback (a port of kanzi-cpp's DivSufSort):
87
+
88
+ ```bash
89
+ cargo build --release --no-default-features
90
+ ```
91
+
92
+ ## Building the Python module
93
+
94
+ Requires [maturin](https://www.maturin.rs/) (`pip install maturin`):
95
+
96
+ ```bash
97
+ maturin build --release
98
+ pip install target/wheels/kanzi_rs-*.whl
99
+ ```
100
+
101
+ Or, for local development (builds in place, reinstalls on every `maturin develop`):
102
+
103
+ ```bash
104
+ pip install maturin
105
+ maturin develop --release
106
+ ```
107
+
108
+ ```python
109
+ import kanzi
110
+
111
+ data = open("input.bin", "rb").read()
112
+ compressed = kanzi.compress(data, 6) # level 0-9
113
+ restored = kanzi.decompress(compressed)
114
+ assert restored == data
115
+
116
+ # Block size defaults to the same per-level value the reference kanzi CLI
117
+ # uses (4 MiB for levels 0-5, 8 MiB for level 6, 16 MiB for levels 7-8,
118
+ # 32 MiB for level 9); override it explicitly if you want a fixed size
119
+ # regardless of level, matching the CLI's -b/--block:
120
+ compressed = kanzi.compress(data, 8, block_size=4 * 1024 * 1024)
121
+
122
+ kanzi.compress_to_file("input.bin", 6) # writes input.bin.kanzi
123
+ kanzi.decompress_to_file("input.bin.kanzi")
124
+ ```
125
+
126
+ The wheel is built per-interpreter (not `abi3`), so it needs building against
127
+ whichever CPython version you're targeting.
128
+
129
+ ### Benchmarking
130
+
131
+ ```bash
132
+ python crates/kanzi-py/examples/benchmark.py
133
+ ```
134
+
135
+ Reports compressed size, ratio and encode/decode throughput per level against real
136
+ files already in the repo (its own docs, source code, the compiled CLI binary, a
137
+ built wheel) plus a random-bytes incompressible baseline — deliberately not
138
+ synthetic/repetitive data, since that's what caught a real encoder bug during
139
+ development (see git log).
140
+
141
+ See [BENCHMARKS.md](BENCHMARKS.md) for numbers against the Silesia corpus, and
142
+ [CHANGELOG.md](CHANGELOG.md) for what changed between releases.
143
+
144
+ ## Status
145
+
146
+ Levels 0-9 round-trip correctly against both a large real-world corpus and the
147
+ reference kanzi-go/kanzi-cpp binaries used for cross-checking in `verify/`. This is
148
+ still a young port: if you find a mismatch, please open an issue with the input that
149
+ triggers it.
150
+
151
+ ## Attribution & license
152
+
153
+ kanzi-rs is a derivative work of [kanzi-go](https://github.com/flanglet/kanzi-go)
154
+ (Copyright 2011-2026 Frederic Langlet), which is licensed under the
155
+ [Apache License, Version 2.0](LICENSE). This project is licensed under the same
156
+ terms; see [LICENSE](LICENSE).
157
+