rust-pgn-reader-python-binding 3.1.0__tar.gz → 3.3.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.
Files changed (19) hide show
  1. {rust_pgn_reader_python_binding-3.1.0 → rust_pgn_reader_python_binding-3.3.0}/Cargo.lock +43 -51
  2. {rust_pgn_reader_python_binding-3.1.0 → rust_pgn_reader_python_binding-3.3.0}/Cargo.toml +8 -5
  3. rust_pgn_reader_python_binding-3.3.0/PKG-INFO +7 -0
  4. {rust_pgn_reader_python_binding-3.1.0 → rust_pgn_reader_python_binding-3.3.0}/benches/parquet_bench.rs +1 -8
  5. rust_pgn_reader_python_binding-3.3.0/rust_pgn_reader_python_binding.pyi +54 -0
  6. {rust_pgn_reader_python_binding-3.1.0 → rust_pgn_reader_python_binding-3.3.0}/src/comment_parsing.rs +96 -76
  7. {rust_pgn_reader_python_binding-3.1.0 → rust_pgn_reader_python_binding-3.3.0}/src/example_str.py +1 -0
  8. {rust_pgn_reader_python_binding-3.1.0 → rust_pgn_reader_python_binding-3.3.0}/src/lib.rs +179 -82
  9. {rust_pgn_reader_python_binding-3.1.0 → rust_pgn_reader_python_binding-3.3.0}/src/test.py +73 -16
  10. rust_pgn_reader_python_binding-3.1.0/PKG-INFO +0 -54
  11. {rust_pgn_reader_python_binding-3.1.0 → rust_pgn_reader_python_binding-3.3.0}/.github/workflows/CI.yml +0 -0
  12. {rust_pgn_reader_python_binding-3.1.0 → rust_pgn_reader_python_binding-3.3.0}/.gitignore +0 -0
  13. {rust_pgn_reader_python_binding-3.1.0 → rust_pgn_reader_python_binding-3.3.0}/README.md +0 -0
  14. {rust_pgn_reader_python_binding-3.1.0 → rust_pgn_reader_python_binding-3.3.0}/pyproject.toml +0 -0
  15. {rust_pgn_reader_python_binding-3.1.0 → rust_pgn_reader_python_binding-3.3.0}/src/bench.py +0 -0
  16. {rust_pgn_reader_python_binding-3.1.0 → rust_pgn_reader_python_binding-3.3.0}/src/bench_parquet.py +0 -0
  17. {rust_pgn_reader_python_binding-3.1.0 → rust_pgn_reader_python_binding-3.3.0}/src/bench_parquet_arrow.py +0 -0
  18. {rust_pgn_reader_python_binding-3.1.0 → rust_pgn_reader_python_binding-3.3.0}/src/bench_parquet_parallel.py +0 -0
  19. {rust_pgn_reader_python_binding-3.1.0 → rust_pgn_reader_python_binding-3.3.0}/src/example_rowgroup.py +0 -0
@@ -341,9 +341,9 @@ dependencies = [
341
341
 
342
342
  [[package]]
343
343
  name = "btoi"
344
- version = "0.4.3"
344
+ version = "0.5.0"
345
345
  source = "registry+https://github.com/rust-lang/crates.io-index"
346
- checksum = "9dd6407f73a9b8b6162d8a2ef999fe6afd7cc15902ebf42c5cd296addf17e0ad"
346
+ checksum = "3b5ab9db53bcda568284df0fd39f6eac24ad6f7ba7ff1168b9e76eba6576b976"
347
347
  dependencies = [
348
348
  "num-traits",
349
349
  ]
@@ -449,12 +449,6 @@ dependencies = [
449
449
  "half",
450
450
  ]
451
451
 
452
- [[package]]
453
- name = "circular"
454
- version = "0.3.0"
455
- source = "registry+https://github.com/rust-lang/crates.io-index"
456
- checksum = "b0fc239e0f6cb375d2402d48afb92f76f5404fd1df208a41930ec81eda078bea"
457
-
458
452
  [[package]]
459
453
  name = "clap"
460
454
  version = "4.5.39"
@@ -602,9 +596,9 @@ dependencies = [
602
596
 
603
597
  [[package]]
604
598
  name = "either"
605
- version = "1.15.0"
599
+ version = "1.13.0"
606
600
  source = "registry+https://github.com/rust-lang/crates.io-index"
607
- checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719"
601
+ checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0"
608
602
 
609
603
  [[package]]
610
604
  name = "equivalent"
@@ -721,9 +715,9 @@ dependencies = [
721
715
 
722
716
  [[package]]
723
717
  name = "indoc"
724
- version = "2.0.6"
718
+ version = "2.0.5"
725
719
  source = "registry+https://github.com/rust-lang/crates.io-index"
726
- checksum = "f4c7245a08504955605670dbf141fceab975f15ca21570696aebe9d2e71576bd"
720
+ checksum = "b248f5224d1d606005e02c97f5aa4e88eeb230488bcc03bc9ca4d7991399f2b5"
727
721
 
728
722
  [[package]]
729
723
  name = "integer-encoding"
@@ -757,11 +751,10 @@ checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c"
757
751
 
758
752
  [[package]]
759
753
  name = "jobserver"
760
- version = "0.1.33"
754
+ version = "0.1.32"
761
755
  source = "registry+https://github.com/rust-lang/crates.io-index"
762
- checksum = "38f262f097c174adebe41eb73d66ae9c06b2844fb0da69969647bbddd9b0538a"
756
+ checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0"
763
757
  dependencies = [
764
- "getrandom 0.3.3",
765
758
  "libc",
766
759
  ]
767
760
 
@@ -847,9 +840,9 @@ dependencies = [
847
840
 
848
841
  [[package]]
849
842
  name = "libc"
850
- version = "0.2.172"
843
+ version = "0.2.174"
851
844
  source = "registry+https://github.com/rust-lang/crates.io-index"
852
- checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa"
845
+ checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776"
853
846
 
854
847
  [[package]]
855
848
  name = "libm"
@@ -1048,9 +1041,9 @@ dependencies = [
1048
1041
 
1049
1042
  [[package]]
1050
1043
  name = "once_cell"
1051
- version = "1.21.3"
1044
+ version = "1.20.2"
1052
1045
  source = "registry+https://github.com/rust-lang/crates.io-index"
1053
- checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d"
1046
+ checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775"
1054
1047
 
1055
1048
  [[package]]
1056
1049
  name = "oorandom"
@@ -1117,12 +1110,11 @@ checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a"
1117
1110
 
1118
1111
  [[package]]
1119
1112
  name = "pgn-reader"
1120
- version = "0.26.0"
1113
+ version = "0.28.0"
1121
1114
  source = "registry+https://github.com/rust-lang/crates.io-index"
1122
- checksum = "1994b0ce2a74829bff0462e229b3f0a138cfb293e22c6a65f7966ff26d304e74"
1115
+ checksum = "d0e07db84c19e093741643903738788e6f773237c7eeb60f9a40191afc2a815a"
1123
1116
  dependencies = [
1124
1117
  "btoi",
1125
- "circular",
1126
1118
  "memchr",
1127
1119
  "shakmaty",
1128
1120
  ]
@@ -1201,9 +1193,9 @@ dependencies = [
1201
1193
 
1202
1194
  [[package]]
1203
1195
  name = "portable-atomic"
1204
- version = "1.11.0"
1196
+ version = "1.10.0"
1205
1197
  source = "registry+https://github.com/rust-lang/crates.io-index"
1206
- checksum = "350e9b48cbc6b0e028b0473b114454c6316e57336ee184ceab6e53f72c178b3e"
1198
+ checksum = "280dc24453071f1b63954171985a0b0d30058d287960968b9b2aca264c8d4ee6"
1207
1199
 
1208
1200
  [[package]]
1209
1201
  name = "portable-atomic-util"
@@ -1216,18 +1208,18 @@ dependencies = [
1216
1208
 
1217
1209
  [[package]]
1218
1210
  name = "proc-macro2"
1219
- version = "1.0.95"
1211
+ version = "1.0.92"
1220
1212
  source = "registry+https://github.com/rust-lang/crates.io-index"
1221
- checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778"
1213
+ checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0"
1222
1214
  dependencies = [
1223
1215
  "unicode-ident",
1224
1216
  ]
1225
1217
 
1226
1218
  [[package]]
1227
1219
  name = "pyo3"
1228
- version = "0.25.0"
1220
+ version = "0.25.1"
1229
1221
  source = "registry+https://github.com/rust-lang/crates.io-index"
1230
- checksum = "f239d656363bcee73afef85277f1b281e8ac6212a1d42aa90e55b90ed43c47a4"
1222
+ checksum = "8970a78afe0628a3e3430376fc5fd76b6b45c4d43360ffd6cdd40bdde72b682a"
1231
1223
  dependencies = [
1232
1224
  "chrono",
1233
1225
  "chrono-tz",
@@ -1264,9 +1256,9 @@ dependencies = [
1264
1256
 
1265
1257
  [[package]]
1266
1258
  name = "pyo3-build-config"
1267
- version = "0.25.0"
1259
+ version = "0.25.1"
1268
1260
  source = "registry+https://github.com/rust-lang/crates.io-index"
1269
- checksum = "755ea671a1c34044fa165247aaf6f419ca39caa6003aee791a0df2713d8f1b6d"
1261
+ checksum = "458eb0c55e7ece017adeba38f2248ff3ac615e53660d7c71a238d7d2a01c7598"
1270
1262
  dependencies = [
1271
1263
  "once_cell",
1272
1264
  "target-lexicon",
@@ -1274,9 +1266,9 @@ dependencies = [
1274
1266
 
1275
1267
  [[package]]
1276
1268
  name = "pyo3-ffi"
1277
- version = "0.25.0"
1269
+ version = "0.25.1"
1278
1270
  source = "registry+https://github.com/rust-lang/crates.io-index"
1279
- checksum = "fc95a2e67091e44791d4ea300ff744be5293f394f1bafd9f78c080814d35956e"
1271
+ checksum = "7114fe5457c61b276ab77c5055f206295b812608083644a5c5b2640c3102565c"
1280
1272
  dependencies = [
1281
1273
  "libc",
1282
1274
  "pyo3-build-config",
@@ -1284,9 +1276,9 @@ dependencies = [
1284
1276
 
1285
1277
  [[package]]
1286
1278
  name = "pyo3-macros"
1287
- version = "0.25.0"
1279
+ version = "0.25.1"
1288
1280
  source = "registry+https://github.com/rust-lang/crates.io-index"
1289
- checksum = "a179641d1b93920829a62f15e87c0ed791b6c8db2271ba0fd7c2686090510214"
1281
+ checksum = "a8725c0a622b374d6cb051d11a0983786448f7785336139c3c94f5aa6bef7e50"
1290
1282
  dependencies = [
1291
1283
  "proc-macro2",
1292
1284
  "pyo3-macros-backend",
@@ -1296,9 +1288,9 @@ dependencies = [
1296
1288
 
1297
1289
  [[package]]
1298
1290
  name = "pyo3-macros-backend"
1299
- version = "0.25.0"
1291
+ version = "0.25.1"
1300
1292
  source = "registry+https://github.com/rust-lang/crates.io-index"
1301
- checksum = "9dff85ebcaab8c441b0e3f7ae40a6963ecea8a9f5e74f647e33fcf5ec9a1e89e"
1293
+ checksum = "4109984c22491085343c05b0dbc54ddc405c3cf7b4374fc533f5c3313a572ccc"
1302
1294
  dependencies = [
1303
1295
  "heck",
1304
1296
  "proc-macro2",
@@ -1309,9 +1301,9 @@ dependencies = [
1309
1301
 
1310
1302
  [[package]]
1311
1303
  name = "quote"
1312
- version = "1.0.40"
1304
+ version = "1.0.37"
1313
1305
  source = "registry+https://github.com/rust-lang/crates.io-index"
1314
- checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d"
1306
+ checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af"
1315
1307
  dependencies = [
1316
1308
  "proc-macro2",
1317
1309
  ]
@@ -1394,7 +1386,7 @@ checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c"
1394
1386
 
1395
1387
  [[package]]
1396
1388
  name = "rust_pgn_reader_python_binding"
1397
- version = "3.1.0"
1389
+ version = "3.3.0"
1398
1390
  dependencies = [
1399
1391
  "arrow",
1400
1392
  "arrow-array",
@@ -1491,9 +1483,9 @@ dependencies = [
1491
1483
 
1492
1484
  [[package]]
1493
1485
  name = "shakmaty"
1494
- version = "0.27.3"
1486
+ version = "0.29.1"
1495
1487
  source = "registry+https://github.com/rust-lang/crates.io-index"
1496
- checksum = "f414cadc4e727893d1a3b0dca62aaef4c1c821dcbd969f0b10a92e12d684d53a"
1488
+ checksum = "334bb41280a79854707d79c117c9818ddeaead15108e951c0b082ba2acedd0d1"
1497
1489
  dependencies = [
1498
1490
  "arrayvec",
1499
1491
  "bitflags",
@@ -1534,9 +1526,9 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"
1534
1526
 
1535
1527
  [[package]]
1536
1528
  name = "syn"
1537
- version = "2.0.101"
1529
+ version = "2.0.91"
1538
1530
  source = "registry+https://github.com/rust-lang/crates.io-index"
1539
- checksum = "8ce2b7fc941b3a24138a0a7cf8e858bfc6a992e7978a068a5c760deb0ed43caf"
1531
+ checksum = "d53cbcb5a243bd33b7858b1d7f4aca2153490815872d86d955d6ea29f743c035"
1540
1532
  dependencies = [
1541
1533
  "proc-macro2",
1542
1534
  "quote",
@@ -1617,15 +1609,15 @@ checksum = "e7b17f197b3050ba473acf9181f7b1d3b66d1cf7356c6cc57886662276e65908"
1617
1609
 
1618
1610
  [[package]]
1619
1611
  name = "unicode-ident"
1620
- version = "1.0.18"
1612
+ version = "1.0.14"
1621
1613
  source = "registry+https://github.com/rust-lang/crates.io-index"
1622
- checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512"
1614
+ checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83"
1623
1615
 
1624
1616
  [[package]]
1625
1617
  name = "unindent"
1626
- version = "0.2.4"
1618
+ version = "0.2.3"
1627
1619
  source = "registry+https://github.com/rust-lang/crates.io-index"
1628
- checksum = "7264e107f553ccae879d21fbea1d6724ac785e8c3bfc762137959b5802826ef3"
1620
+ checksum = "c7de7d73e1754487cb58364ee906a499937a0dfabd86bcb980fa99ec8c8fa2ce"
1629
1621
 
1630
1622
  [[package]]
1631
1623
  name = "version_check"
@@ -1913,18 +1905,18 @@ dependencies = [
1913
1905
 
1914
1906
  [[package]]
1915
1907
  name = "zstd-safe"
1916
- version = "7.2.4"
1908
+ version = "7.2.1"
1917
1909
  source = "registry+https://github.com/rust-lang/crates.io-index"
1918
- checksum = "8f49c4d5f0abb602a93fb8736af2a4f4dd9512e36f7f570d66e65ff867ed3b9d"
1910
+ checksum = "54a3ab4db68cea366acc5c897c7b4d4d1b8994a9cd6e6f841f8964566a419059"
1919
1911
  dependencies = [
1920
1912
  "zstd-sys",
1921
1913
  ]
1922
1914
 
1923
1915
  [[package]]
1924
1916
  name = "zstd-sys"
1925
- version = "2.0.15+zstd.1.5.7"
1917
+ version = "2.0.13+zstd.1.5.6"
1926
1918
  source = "registry+https://github.com/rust-lang/crates.io-index"
1927
- checksum = "eb81183ddd97d0c74cedf1d50d85c8d08c1b8b68ee863bdee9e706eedba1a237"
1919
+ checksum = "38ff0f21cfee8f97d94cef41359e0c89aa6113028ab0291aa8ca0038995a95aa"
1928
1920
  dependencies = [
1929
1921
  "cc",
1930
1922
  "pkg-config",
@@ -1,7 +1,8 @@
1
1
  [package]
2
2
  name = "rust_pgn_reader_python_binding"
3
- version = "3.1.0"
4
- edition = "2021"
3
+ version = "3.3.0"
4
+ edition = "2024"
5
+ readme = "README.md"
5
6
 
6
7
  # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
7
8
  [lib]
@@ -10,9 +11,9 @@ crate-type = ["lib", "cdylib"]
10
11
  # lib is needed for the native benchmark
11
12
 
12
13
  [dependencies]
13
- pyo3 = "0.25.0"
14
- shakmaty = "0.27"
15
- pgn-reader = "0.26.0"
14
+ pyo3 = "0.25.1"
15
+ shakmaty = "0.29"
16
+ pgn-reader = "0.28.0"
16
17
  nom = "8.0"
17
18
  rayon = "1.10"
18
19
  num_cpus = "1.17"
@@ -28,3 +29,5 @@ arrow = "55"
28
29
  harness = false
29
30
  name = "parquet_bench"
30
31
 
32
+ [profile.bench]
33
+ debug = true
@@ -0,0 +1,7 @@
1
+ Metadata-Version: 2.4
2
+ Name: rust_pgn_reader_python_binding
3
+ Version: 3.3.0
4
+ Classifier: Programming Language :: Rust
5
+ Classifier: Programming Language :: Python :: Implementation :: CPython
6
+ Classifier: Programming Language :: Python :: Implementation :: PyPy
7
+ Requires-Python: >=3.8
@@ -1,16 +1,9 @@
1
1
  use arrow::array::{Array, StringArray};
2
-
3
2
  use parquet::arrow::arrow_reader::ParquetRecordBatchReaderBuilder;
4
-
5
- // use parquet::file::reader::{FileReader, SerializedFileReader};
6
- // use parquet::record::RowAccessor;
7
-
8
3
  use std::fs::File;
9
4
  use std::path::Path;
10
5
  use std::time::Instant;
11
6
 
12
- // use criterion::{criterion_group, criterion_main, Criterion};
13
-
14
7
  use rust_pgn_reader_python_binding::parse_multiple_games_native;
15
8
 
16
9
  pub fn bench_parquet() {
@@ -50,7 +43,7 @@ pub fn bench_parquet() {
50
43
  // Measure start time
51
44
  let start = Instant::now();
52
45
 
53
- let result = parse_multiple_games_native(&movetexts, None);
46
+ let result = parse_multiple_games_native(&movetexts, None, false);
54
47
 
55
48
  let duration = start.elapsed();
56
49
  println!("Time taken: {:?}", duration);
@@ -0,0 +1,54 @@
1
+ from typing import List, Optional, Tuple
2
+ import pyarrow
3
+
4
+ class PyUciMove:
5
+ from_square: int
6
+ to_square: int
7
+ promotion: Optional[int]
8
+
9
+ def __init__(
10
+ self, from_square: int, to_square: int, promotion: Optional[int]
11
+ ) -> None: ...
12
+ @property
13
+ def get_from_square_name(self) -> str: ...
14
+ @property
15
+ def get_to_square_name(self) -> str: ...
16
+ @property
17
+ def get_promotion_name(self) -> Optional[str]: ...
18
+ def __str__(self) -> str: ...
19
+ def __repr__(self) -> str: ...
20
+
21
+ class PositionStatus:
22
+ is_checkmate: bool
23
+ is_stalemate: bool
24
+ legal_move_count: int
25
+ is_game_over: bool
26
+ insufficient_material: Tuple[bool, bool]
27
+ turn: bool
28
+
29
+ class MoveExtractor:
30
+ moves: List[PyUciMove]
31
+ valid_moves: bool
32
+ comments: List[Optional[str]]
33
+ evals: List[Optional[float]]
34
+ clock_times: List[Optional[Tuple[int, int, float]]]
35
+ outcome: Optional[str]
36
+ headers: List[Tuple[str, str]]
37
+ castling_rights: List[Optional[Tuple[bool, bool, bool, bool]]]
38
+ position_status: Optional[PositionStatus]
39
+
40
+ def __init__(self, store_legal_moves: bool = False) -> None: ...
41
+ def turn(self) -> bool: ...
42
+ def update_position_status(self) -> None: ...
43
+ @property
44
+ def legal_moves(self) -> List[List[PyUciMove]]: ...
45
+
46
+ def parse_game(pgn: str, store_legal_moves: bool = False) -> MoveExtractor: ...
47
+ def parse_games(
48
+ pgns: List[str], num_threads: Optional[int] = None, store_legal_moves: bool = False
49
+ ) -> List[MoveExtractor]: ...
50
+ def parse_game_moves_arrow_chunked_array(
51
+ pgn_chunked_array: pyarrow.ChunkedArray,
52
+ num_threads: Optional[int] = None,
53
+ store_legal_moves: bool = False,
54
+ ) -> List[MoveExtractor]: ...