csvidx 0.1.0__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.
@@ -0,0 +1,39 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main, master]
6
+ pull_request:
7
+
8
+ env:
9
+ CARGO_TERM_COLOR: always
10
+
11
+ jobs:
12
+ rust:
13
+ name: Rust tests
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+ - uses: dtolnay/rust-toolchain@stable
18
+ - uses: Swatinem/rust-cache@v2
19
+ - run: cargo build --release
20
+ - run: cargo test --release
21
+
22
+ python:
23
+ name: Python bindings
24
+ runs-on: ubuntu-latest
25
+ steps:
26
+ - uses: actions/checkout@v4
27
+ - uses: dtolnay/rust-toolchain@stable
28
+ - uses: Swatinem/rust-cache@v2
29
+ - uses: actions/setup-python@v5
30
+ with:
31
+ python-version: "3.12"
32
+ - run: pip install maturin pytest pandas pyarrow duckdb
33
+ - run: maturin develop --release
34
+ working-directory: python
35
+ env:
36
+ VIRTUAL_ENV: ""
37
+ - run: python -m pytest -q python/tests
38
+ - name: Python oracle (independent CSV parser)
39
+ run: python -I scripts/oracle_test.py
@@ -0,0 +1,8 @@
1
+ /target
2
+ /data*
3
+ *.idx
4
+ *.idx.tmp
5
+ __pycache__/
6
+ .venv-py/
7
+ *.so
8
+ .DS_Store
@@ -0,0 +1,448 @@
1
+ # This file is automatically @generated by Cargo.
2
+ # It is not intended for manual editing.
3
+ version = 4
4
+
5
+ [[package]]
6
+ name = "anstream"
7
+ version = "1.0.0"
8
+ source = "registry+https://github.com/rust-lang/crates.io-index"
9
+ checksum = "824a212faf96e9acacdbd09febd34438f8f711fb84e09a8916013cd7815ca28d"
10
+ dependencies = [
11
+ "anstyle",
12
+ "anstyle-parse",
13
+ "anstyle-query",
14
+ "anstyle-wincon",
15
+ "colorchoice",
16
+ "is_terminal_polyfill",
17
+ "utf8parse",
18
+ ]
19
+
20
+ [[package]]
21
+ name = "anstyle"
22
+ version = "1.0.14"
23
+ source = "registry+https://github.com/rust-lang/crates.io-index"
24
+ checksum = "940b3a0ca603d1eade50a4846a2afffd5ef57a9feac2c0e2ec2e14f9ead76000"
25
+
26
+ [[package]]
27
+ name = "anstyle-parse"
28
+ version = "1.0.0"
29
+ source = "registry+https://github.com/rust-lang/crates.io-index"
30
+ checksum = "52ce7f38b242319f7cabaa6813055467063ecdc9d355bbb4ce0c68908cd8130e"
31
+ dependencies = [
32
+ "utf8parse",
33
+ ]
34
+
35
+ [[package]]
36
+ name = "anstyle-query"
37
+ version = "1.1.5"
38
+ source = "registry+https://github.com/rust-lang/crates.io-index"
39
+ checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc"
40
+ dependencies = [
41
+ "windows-sys",
42
+ ]
43
+
44
+ [[package]]
45
+ name = "anstyle-wincon"
46
+ version = "3.0.11"
47
+ source = "registry+https://github.com/rust-lang/crates.io-index"
48
+ checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d"
49
+ dependencies = [
50
+ "anstyle",
51
+ "once_cell_polyfill",
52
+ "windows-sys",
53
+ ]
54
+
55
+ [[package]]
56
+ name = "anyhow"
57
+ version = "1.0.104"
58
+ source = "registry+https://github.com/rust-lang/crates.io-index"
59
+ checksum = "330a5ed07fa54e4702c9d6c4174f74427fc0ef6e214bbd677ae50a5099946470"
60
+
61
+ [[package]]
62
+ name = "bitflags"
63
+ version = "2.13.2"
64
+ source = "registry+https://github.com/rust-lang/crates.io-index"
65
+ checksum = "3ded4057c258ba199e2d26386d3af3780957ecaee6c4ef4041c6b4b8b97c0b06"
66
+
67
+ [[package]]
68
+ name = "cfg-if"
69
+ version = "1.0.5"
70
+ source = "registry+https://github.com/rust-lang/crates.io-index"
71
+ checksum = "4e7648175b45a9a48536d676f68d918270699102aa8dab5496df06904c914600"
72
+
73
+ [[package]]
74
+ name = "clap"
75
+ version = "4.6.7"
76
+ source = "registry+https://github.com/rust-lang/crates.io-index"
77
+ checksum = "aa8876b300ab35ba921adea3dfd70157a46249b33f95c9084ae5709785478946"
78
+ dependencies = [
79
+ "clap_builder",
80
+ "clap_derive",
81
+ ]
82
+
83
+ [[package]]
84
+ name = "clap_builder"
85
+ version = "4.6.7"
86
+ source = "registry+https://github.com/rust-lang/crates.io-index"
87
+ checksum = "ec0797fb7aeb1406c84efac526901f7ec3ead2124f946b494e72879d4b54704d"
88
+ dependencies = [
89
+ "anstream",
90
+ "anstyle",
91
+ "clap_lex",
92
+ "strsim",
93
+ ]
94
+
95
+ [[package]]
96
+ name = "clap_derive"
97
+ version = "4.6.7"
98
+ source = "registry+https://github.com/rust-lang/crates.io-index"
99
+ checksum = "f9c751b79415d4e559e3d1fcf128e09e720eb673a06d26cf6f392d37d75b66e0"
100
+ dependencies = [
101
+ "heck",
102
+ "proc-macro2",
103
+ "quote",
104
+ "syn",
105
+ ]
106
+
107
+ [[package]]
108
+ name = "clap_lex"
109
+ version = "1.1.1"
110
+ source = "registry+https://github.com/rust-lang/crates.io-index"
111
+ checksum = "1c133bc6a41be0d194c306b5506d15e6feeea7b1d6604bd3f8310dfb2ca96486"
112
+
113
+ [[package]]
114
+ name = "colorchoice"
115
+ version = "1.0.5"
116
+ source = "registry+https://github.com/rust-lang/crates.io-index"
117
+ checksum = "1d07550c9036bf2ae0c684c4297d503f838287c83c53686d05370d0e139ae570"
118
+
119
+ [[package]]
120
+ name = "crc32fast"
121
+ version = "1.5.5"
122
+ source = "registry+https://github.com/rust-lang/crates.io-index"
123
+ checksum = "2b929dd2a135771f40afabd1073f85eed59c800b7c61901e5c254270497dad64"
124
+ dependencies = [
125
+ "cfg-if",
126
+ ]
127
+
128
+ [[package]]
129
+ name = "crossbeam-deque"
130
+ version = "0.8.8"
131
+ source = "registry+https://github.com/rust-lang/crates.io-index"
132
+ checksum = "622f3fc73690be383c7214310406f28a90e6edeadc3cea882f9d71e495b9711a"
133
+ dependencies = [
134
+ "crossbeam-epoch",
135
+ "crossbeam-utils",
136
+ ]
137
+
138
+ [[package]]
139
+ name = "crossbeam-epoch"
140
+ version = "0.9.21"
141
+ source = "registry+https://github.com/rust-lang/crates.io-index"
142
+ checksum = "dc74980687109a3b14c72fd458107bf0baa1da1a1a805e178d15501ba9b86d9d"
143
+ dependencies = [
144
+ "crossbeam-utils",
145
+ ]
146
+
147
+ [[package]]
148
+ name = "crossbeam-utils"
149
+ version = "0.8.23"
150
+ source = "registry+https://github.com/rust-lang/crates.io-index"
151
+ checksum = "a31eee39dddec8330830986fcd7625edb5a24ec90ea038215273bbc3adb08ac6"
152
+
153
+ [[package]]
154
+ name = "csvidx"
155
+ version = "0.1.0"
156
+ dependencies = [
157
+ "anyhow",
158
+ "clap",
159
+ "crc32fast",
160
+ "libc",
161
+ "memchr",
162
+ "memmap2",
163
+ "rayon",
164
+ "tempfile",
165
+ "xxhash-rust",
166
+ ]
167
+
168
+ [[package]]
169
+ name = "csvidx-py"
170
+ version = "0.1.0"
171
+ dependencies = [
172
+ "anyhow",
173
+ "csvidx",
174
+ "pyo3",
175
+ ]
176
+
177
+ [[package]]
178
+ name = "either"
179
+ version = "1.19.0"
180
+ source = "registry+https://github.com/rust-lang/crates.io-index"
181
+ checksum = "0e9c71c2167ca323c882b99918929403426e2373ea17242ff5653e0d5e1058be"
182
+
183
+ [[package]]
184
+ name = "errno"
185
+ version = "0.3.14"
186
+ source = "registry+https://github.com/rust-lang/crates.io-index"
187
+ checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb"
188
+ dependencies = [
189
+ "libc",
190
+ "windows-sys",
191
+ ]
192
+
193
+ [[package]]
194
+ name = "fastrand"
195
+ version = "2.5.0"
196
+ source = "registry+https://github.com/rust-lang/crates.io-index"
197
+ checksum = "da7c62ceae207dd37ea5b845da6a0696c799f85e97da1ab5b7910be3c1c80223"
198
+
199
+ [[package]]
200
+ name = "getrandom"
201
+ version = "0.4.3"
202
+ source = "registry+https://github.com/rust-lang/crates.io-index"
203
+ checksum = "300e883d756b2e4ec94e02791f39b04b522276138852cfc41d9fb7e904106099"
204
+ dependencies = [
205
+ "cfg-if",
206
+ "libc",
207
+ "r-efi",
208
+ ]
209
+
210
+ [[package]]
211
+ name = "heck"
212
+ version = "0.5.0"
213
+ source = "registry+https://github.com/rust-lang/crates.io-index"
214
+ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
215
+
216
+ [[package]]
217
+ name = "is_terminal_polyfill"
218
+ version = "1.70.2"
219
+ source = "registry+https://github.com/rust-lang/crates.io-index"
220
+ checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695"
221
+
222
+ [[package]]
223
+ name = "libc"
224
+ version = "0.2.191"
225
+ source = "registry+https://github.com/rust-lang/crates.io-index"
226
+ checksum = "65cd87c9a6d60536580b316ad985726104730a5151c99845f2490428ef91240a"
227
+
228
+ [[package]]
229
+ name = "linux-raw-sys"
230
+ version = "0.12.1"
231
+ source = "registry+https://github.com/rust-lang/crates.io-index"
232
+ checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53"
233
+
234
+ [[package]]
235
+ name = "memchr"
236
+ version = "2.8.3"
237
+ source = "registry+https://github.com/rust-lang/crates.io-index"
238
+ checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98"
239
+
240
+ [[package]]
241
+ name = "memmap2"
242
+ version = "0.9.12"
243
+ source = "registry+https://github.com/rust-lang/crates.io-index"
244
+ checksum = "6b0ca1155a9ecc25aa12e8313a119f32edf0255fea2f44839c4ac0a12b2ac157"
245
+ dependencies = [
246
+ "libc",
247
+ ]
248
+
249
+ [[package]]
250
+ name = "once_cell"
251
+ version = "1.21.4"
252
+ source = "registry+https://github.com/rust-lang/crates.io-index"
253
+ checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50"
254
+
255
+ [[package]]
256
+ name = "once_cell_polyfill"
257
+ version = "1.70.2"
258
+ source = "registry+https://github.com/rust-lang/crates.io-index"
259
+ checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe"
260
+
261
+ [[package]]
262
+ name = "portable-atomic"
263
+ version = "1.15.0"
264
+ source = "registry+https://github.com/rust-lang/crates.io-index"
265
+ checksum = "05c8b63e8d9609db387f0324918f81d68fe27748f084ef092fb35954d0539a85"
266
+
267
+ [[package]]
268
+ name = "proc-macro2"
269
+ version = "1.0.107"
270
+ source = "registry+https://github.com/rust-lang/crates.io-index"
271
+ checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9"
272
+ dependencies = [
273
+ "unicode-ident",
274
+ ]
275
+
276
+ [[package]]
277
+ name = "pyo3"
278
+ version = "0.30.1"
279
+ source = "registry+https://github.com/rust-lang/crates.io-index"
280
+ checksum = "229ca13b8a15bb0d1487b81ab975bfcd97513416499a8312011b6036e42e0de4"
281
+ dependencies = [
282
+ "libc",
283
+ "once_cell",
284
+ "portable-atomic",
285
+ "pyo3-build-config",
286
+ "pyo3-ffi",
287
+ "pyo3-macros",
288
+ ]
289
+
290
+ [[package]]
291
+ name = "pyo3-build-config"
292
+ version = "0.30.1"
293
+ source = "registry+https://github.com/rust-lang/crates.io-index"
294
+ checksum = "70130e2b6dd1ee589a8788026a429561ca5c40fa7a2fa7914c2282eddae24700"
295
+ dependencies = [
296
+ "target-lexicon",
297
+ ]
298
+
299
+ [[package]]
300
+ name = "pyo3-ffi"
301
+ version = "0.30.1"
302
+ source = "registry+https://github.com/rust-lang/crates.io-index"
303
+ checksum = "5e7ff73c555c286d212d4ce7e5fbda845a973c4f61bd5f160f5f2c3c2a04d1c4"
304
+ dependencies = [
305
+ "libc",
306
+ "pyo3-build-config",
307
+ ]
308
+
309
+ [[package]]
310
+ name = "pyo3-macros"
311
+ version = "0.30.1"
312
+ source = "registry+https://github.com/rust-lang/crates.io-index"
313
+ checksum = "c46d2e5862c7bb8207e3b639f713dda3c499933444784154c11d013c5a691b60"
314
+ dependencies = [
315
+ "proc-macro2",
316
+ "pyo3-macros-backend",
317
+ "quote",
318
+ "syn",
319
+ ]
320
+
321
+ [[package]]
322
+ name = "pyo3-macros-backend"
323
+ version = "0.30.1"
324
+ source = "registry+https://github.com/rust-lang/crates.io-index"
325
+ checksum = "38b89f066f2ae72a2aef52d1537ca2fcd104440ebfadee06e97aa90738a25b9b"
326
+ dependencies = [
327
+ "heck",
328
+ "proc-macro2",
329
+ "quote",
330
+ "syn",
331
+ ]
332
+
333
+ [[package]]
334
+ name = "quote"
335
+ version = "1.0.47"
336
+ source = "registry+https://github.com/rust-lang/crates.io-index"
337
+ checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001"
338
+ dependencies = [
339
+ "proc-macro2",
340
+ ]
341
+
342
+ [[package]]
343
+ name = "r-efi"
344
+ version = "6.0.0"
345
+ source = "registry+https://github.com/rust-lang/crates.io-index"
346
+ checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf"
347
+
348
+ [[package]]
349
+ name = "rayon"
350
+ version = "1.12.0"
351
+ source = "registry+https://github.com/rust-lang/crates.io-index"
352
+ checksum = "fb39b166781f92d482534ef4b4b1b2568f42613b53e5b6c160e24cfbfa30926d"
353
+ dependencies = [
354
+ "either",
355
+ "rayon-core",
356
+ ]
357
+
358
+ [[package]]
359
+ name = "rayon-core"
360
+ version = "1.13.0"
361
+ source = "registry+https://github.com/rust-lang/crates.io-index"
362
+ checksum = "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91"
363
+ dependencies = [
364
+ "crossbeam-deque",
365
+ "crossbeam-utils",
366
+ ]
367
+
368
+ [[package]]
369
+ name = "rustix"
370
+ version = "1.1.6"
371
+ source = "registry+https://github.com/rust-lang/crates.io-index"
372
+ checksum = "e5e76742e5294153d4dde1207dbec5bdd81eef6fabdc0d2118babadabfd858aa"
373
+ dependencies = [
374
+ "bitflags",
375
+ "errno",
376
+ "libc",
377
+ "linux-raw-sys",
378
+ "windows-sys",
379
+ ]
380
+
381
+ [[package]]
382
+ name = "strsim"
383
+ version = "0.11.1"
384
+ source = "registry+https://github.com/rust-lang/crates.io-index"
385
+ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f"
386
+
387
+ [[package]]
388
+ name = "syn"
389
+ version = "3.0.10"
390
+ source = "registry+https://github.com/rust-lang/crates.io-index"
391
+ checksum = "4ae9ccbea3a7b0b09443036490c8f34a8b1b760fd345e5c0dae0aac718faea79"
392
+ dependencies = [
393
+ "proc-macro2",
394
+ "quote",
395
+ "unicode-ident",
396
+ ]
397
+
398
+ [[package]]
399
+ name = "target-lexicon"
400
+ version = "0.13.5"
401
+ source = "registry+https://github.com/rust-lang/crates.io-index"
402
+ checksum = "adb6935a6f5c20170eeceb1a3835a49e12e19d792f6dd344ccc76a985ca5a6ca"
403
+
404
+ [[package]]
405
+ name = "tempfile"
406
+ version = "3.27.0"
407
+ source = "registry+https://github.com/rust-lang/crates.io-index"
408
+ checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd"
409
+ dependencies = [
410
+ "fastrand",
411
+ "getrandom",
412
+ "once_cell",
413
+ "rustix",
414
+ "windows-sys",
415
+ ]
416
+
417
+ [[package]]
418
+ name = "unicode-ident"
419
+ version = "1.0.27"
420
+ source = "registry+https://github.com/rust-lang/crates.io-index"
421
+ checksum = "a2c754d6c33795a1c324727428e5a7dedb5b06195f9890bdbcba760d3e246563"
422
+
423
+ [[package]]
424
+ name = "utf8parse"
425
+ version = "0.2.2"
426
+ source = "registry+https://github.com/rust-lang/crates.io-index"
427
+ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821"
428
+
429
+ [[package]]
430
+ name = "windows-link"
431
+ version = "0.2.1"
432
+ source = "registry+https://github.com/rust-lang/crates.io-index"
433
+ checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5"
434
+
435
+ [[package]]
436
+ name = "windows-sys"
437
+ version = "0.61.2"
438
+ source = "registry+https://github.com/rust-lang/crates.io-index"
439
+ checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc"
440
+ dependencies = [
441
+ "windows-link",
442
+ ]
443
+
444
+ [[package]]
445
+ name = "xxhash-rust"
446
+ version = "0.8.19"
447
+ source = "registry+https://github.com/rust-lang/crates.io-index"
448
+ checksum = "550a2b930b62486a393c52d5c3b84bff264b28aa437ed64694d31e93b1757af7"
@@ -0,0 +1,36 @@
1
+ [package]
2
+ name = "csvidx"
3
+ version = "0.1.0"
4
+ edition = "2021"
5
+ description = "Secondary index for huge CSV files: lookup by key without importing"
6
+ license = "MIT"
7
+ repository = "https://github.com/hoopengo/csvidx"
8
+ readme = "README.md"
9
+ keywords = ["csv", "index", "search", "data"]
10
+ categories = ["database-implementations", "command-line-utilities"]
11
+
12
+ [workspace]
13
+ members = ["python"]
14
+
15
+ [dependencies]
16
+ anyhow = "1"
17
+ clap = { version = "4", features = ["derive"] }
18
+ crc32fast = "1"
19
+ memchr = "2"
20
+ memmap2 = "0.9"
21
+ rayon = "1"
22
+ xxhash-rust = { version = "0.8", features = ["xxh3"] }
23
+
24
+ [target.'cfg(unix)'.dependencies]
25
+ libc = "0.2"
26
+
27
+ [dev-dependencies]
28
+ tempfile = "3"
29
+
30
+ [profile.release]
31
+ opt-level = 3
32
+ lto = true
33
+ codegen-units = 1
34
+ # rustc's default strip of debuginfo produces dylibs macOS 27 dyld rejects
35
+ # ("mis-aligned LINKEDIT string pool"); until rust >= 1.99, keep strip off.
36
+ strip = false
csvidx-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Alexey Honey (hoopengo)
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.