pkpython 0.7.0__tar.gz → 0.8.1__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 (34) hide show
  1. {pkpython-0.7.0 → pkpython-0.8.1}/CHANGELOG.md +8 -0
  2. pkpython-0.8.1/CLAUDE.md +7 -0
  3. {pkpython-0.7.0 → pkpython-0.8.1}/Cargo.lock +14 -14
  4. {pkpython-0.7.0 → pkpython-0.8.1}/Cargo.toml +3 -3
  5. pkpython-0.8.1/LICENSE-APACHE +201 -0
  6. pkpython-0.8.1/LICENSE-MIT +21 -0
  7. {pkpython-0.7.0 → pkpython-0.8.1}/PKG-INFO +23 -6
  8. {pkpython-0.7.0 → pkpython-0.8.1}/README.md +17 -2
  9. {pkpython-0.7.0 → pkpython-0.8.1}/pyproject.toml +3 -2
  10. {pkpython-0.7.0 → pkpython-0.8.1}/src/lib.rs +36 -24
  11. {pkpython-0.7.0 → pkpython-0.8.1}/src/table_no_cell.rs +2 -3
  12. pkpython-0.7.0/LICENSE +0 -674
  13. {pkpython-0.7.0 → pkpython-0.8.1}/.github/workflows/ci.yml +0 -0
  14. {pkpython-0.7.0 → pkpython-0.8.1}/.github/workflows/publish.yml +0 -0
  15. {pkpython-0.7.0 → pkpython-0.8.1}/.gitignore +0 -0
  16. {pkpython-0.7.0 → pkpython-0.8.1}/Makefile +0 -0
  17. {pkpython-0.7.0 → pkpython-0.8.1}/demo.py +0 -0
  18. {pkpython-0.7.0 → pkpython-0.8.1}/docs/STACK.md +0 -0
  19. {pkpython-0.7.0 → pkpython-0.8.1}/docs/pypi-publishing-plan.md +0 -0
  20. {pkpython-0.7.0 → pkpython-0.8.1}/docs/superpowers/plans/2026-04-28-pkpy-0.0.52-upgrade.md +0 -0
  21. {pkpython-0.7.0 → pkpython-0.8.1}/docs/superpowers/plans/2026-04-29-pkpy-pokersession-tablenocell.md +0 -0
  22. {pkpython-0.7.0 → pkpython-0.8.1}/docs/superpowers/specs/2026-04-28-pkpy-0.0.52-upgrade-design.md +0 -0
  23. {pkpython-0.7.0 → pkpython-0.8.1}/docs/superpowers/specs/2026-04-29-pkpy-pokersession-tablenocell-design.md +0 -0
  24. {pkpython-0.7.0 → pkpython-0.8.1}/examples/calc.py +0 -0
  25. {pkpython-0.7.0 → pkpython-0.8.1}/examples/gto.py +0 -0
  26. {pkpython-0.7.0 → pkpython-0.8.1}/examples/the_hand.py +0 -0
  27. {pkpython-0.7.0 → pkpython-0.8.1}/python/pkpy/__init__.py +0 -0
  28. {pkpython-0.7.0 → pkpython-0.8.1}/src/bot.rs +0 -0
  29. {pkpython-0.7.0 → pkpython-0.8.1}/src/hand_history.rs +0 -0
  30. {pkpython-0.7.0 → pkpython-0.8.1}/src/session.rs +0 -0
  31. {pkpython-0.7.0 → pkpython-0.8.1}/src/stats.rs +0 -0
  32. {pkpython-0.7.0 → pkpython-0.8.1}/tests/test_pkpy.py +0 -0
  33. {pkpython-0.7.0 → pkpython-0.8.1}/tests/test_session.py +0 -0
  34. {pkpython-0.7.0 → pkpython-0.8.1}/tests/test_table_no_cell.py +0 -0
@@ -6,6 +6,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project tracks [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
  The crate version is kept in lockstep with the underlying `pkcore` dependency.
8
8
 
9
+ ## [Unreleased]
10
+
11
+ ### Changed
12
+
13
+ - Relicensed from `GPL-3.0-or-later` to `MIT OR Apache-2.0`, matching `pkcore`.
14
+ Replaced `LICENSE` with `LICENSE-MIT` and `LICENSE-APACHE`; updated
15
+ `Cargo.toml`, `pyproject.toml` classifiers, and the README badges.
16
+
9
17
  ## [0.7.0] - 2026-08-22
10
18
 
11
19
  ### Changed
@@ -0,0 +1,7 @@
1
+ # pkpy project instructions
2
+
3
+ ## Version rule
4
+
5
+ `pkpy`'s version in `Cargo.toml` must always match the `pkcore` dependency
6
+ version. When `pkcore` is bumped, bump `pkpy`'s own `version` field to the
7
+ same value in the same change.
@@ -224,7 +224,7 @@ dependencies = [
224
224
  "heck",
225
225
  "proc-macro2",
226
226
  "quote",
227
- "syn 3.0.3",
227
+ "syn 3.0.4",
228
228
  ]
229
229
 
230
230
  [[package]]
@@ -352,7 +352,7 @@ checksum = "c6232dd377dcc64799954cbd3a9bb882e9cdc1308ccd87b1c098f1fb2eaf82a8"
352
352
  dependencies = [
353
353
  "proc-macro2",
354
354
  "quote",
355
- "syn 3.0.3",
355
+ "syn 3.0.4",
356
356
  ]
357
357
 
358
358
  [[package]]
@@ -828,9 +828,9 @@ checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd"
828
828
 
829
829
  [[package]]
830
830
  name = "pkcore"
831
- version = "0.7.0"
831
+ version = "0.8.2"
832
832
  source = "registry+https://github.com/rust-lang/crates.io-index"
833
- checksum = "9c03fe516554011cc3c9a78e618a9f0ec9f7a7e30b644f83725c4d4ce4bf2f84"
833
+ checksum = "9b06659be4c71f2a16306c141bf8b57009277a0257b0b3b82edffdac27ad8366"
834
834
  dependencies = [
835
835
  "bint",
836
836
  "bitvec",
@@ -869,7 +869,7 @@ checksum = "f6b464fbc74e149a392436b17d523f769e057cb6877f6a5c4618bc6f11800548"
869
869
 
870
870
  [[package]]
871
871
  name = "pkpy"
872
- version = "0.7.0"
872
+ version = "0.8.1"
873
873
  dependencies = [
874
874
  "pkcore",
875
875
  "pyo3",
@@ -1016,9 +1016,9 @@ checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09"
1016
1016
 
1017
1017
  [[package]]
1018
1018
  name = "rand"
1019
- version = "0.8.7"
1019
+ version = "0.8.8"
1020
1020
  source = "registry+https://github.com/rust-lang/crates.io-index"
1021
- checksum = "22f6172bdec972074665ed81ed53b71da00bfc44b65a753cfde883ec4c702a1a"
1021
+ checksum = "e058c7de0b26af77780c769414d6257830bb240f3c38477dbc2c16e5f54d6d4c"
1022
1022
  dependencies = [
1023
1023
  "libc",
1024
1024
  "rand_chacha 0.3.1",
@@ -1084,7 +1084,7 @@ dependencies = [
1084
1084
  "clap",
1085
1085
  "lazy_static",
1086
1086
  "log",
1087
- "rand 0.8.7",
1087
+ "rand 0.8.8",
1088
1088
  "regex",
1089
1089
  "rust-embed",
1090
1090
  "titlecase",
@@ -1254,7 +1254,7 @@ checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348"
1254
1254
  dependencies = [
1255
1255
  "proc-macro2",
1256
1256
  "quote",
1257
- "syn 3.0.3",
1257
+ "syn 3.0.4",
1258
1258
  ]
1259
1259
 
1260
1260
  [[package]]
@@ -1384,9 +1384,9 @@ dependencies = [
1384
1384
 
1385
1385
  [[package]]
1386
1386
  name = "syn"
1387
- version = "3.0.3"
1387
+ version = "3.0.4"
1388
1388
  source = "registry+https://github.com/rust-lang/crates.io-index"
1389
- checksum = "53e9bae58849f64dfa4f5d5ae372c8341f7305f82a3868709269343628b659a3"
1389
+ checksum = "e6275cddf4610d1775e6d1fe9469b2e77d0f39fd98fb7450901b821e0c53649f"
1390
1390
  dependencies = [
1391
1391
  "proc-macro2",
1392
1392
  "quote",
@@ -1432,7 +1432,7 @@ checksum = "bc04cd3e1236dd4a98afca4569f2deb3f120e5422a4023be2cb683f8486292af"
1432
1432
  dependencies = [
1433
1433
  "proc-macro2",
1434
1434
  "quote",
1435
- "syn 3.0.3",
1435
+ "syn 3.0.4",
1436
1436
  ]
1437
1437
 
1438
1438
  [[package]]
@@ -1547,9 +1547,9 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821"
1547
1547
 
1548
1548
  [[package]]
1549
1549
  name = "uuid"
1550
- version = "1.25.0"
1550
+ version = "1.26.0"
1551
1551
  source = "registry+https://github.com/rust-lang/crates.io-index"
1552
- checksum = "f053576934f05a761a402421fbbe3d425d9366f75f978806a037b3ca481abecc"
1552
+ checksum = "b5772d71c9be8a8a6ac2117d949c5b224c1b72241bb611d9a3012edcf8af7812"
1553
1553
  dependencies = [
1554
1554
  "getrandom 0.4.3",
1555
1555
  "js-sys",
@@ -1,9 +1,9 @@
1
1
  [package]
2
2
  name = "pkpy"
3
- version = "0.7.0"
3
+ version = "0.8.1"
4
4
  edition = "2021"
5
5
  description = "Python bindings for pkcore, a high-performance poker analysis library"
6
- license = "GPL-3.0-or-later"
6
+ license = "MIT OR Apache-2.0"
7
7
  readme = "README.md"
8
8
 
9
9
  [lib]
@@ -12,7 +12,7 @@ crate-type = ["cdylib"]
12
12
 
13
13
  [dependencies]
14
14
  pyo3 = { version = "0.28", features = ["extension-module"] }
15
- pkcore = { version = "0.7.0", features = ["store"] }
15
+ pkcore = { version = "0.8.0", features = ["store"] }
16
16
 
17
17
  [profile.release]
18
18
  lto = true
@@ -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 2026 ImperialBower
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.
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2026 ImperialBower
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.
@@ -1,15 +1,17 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pkpython
3
- Version: 0.7.0
3
+ Version: 0.8.1
4
4
  Classifier: Programming Language :: Rust
5
5
  Classifier: Programming Language :: Python :: Implementation :: CPython
6
6
  Classifier: Programming Language :: Python :: Implementation :: PyPy
7
7
  Classifier: Topic :: Games/Entertainment
8
- Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
9
- License-File: LICENSE
8
+ Classifier: License :: OSI Approved :: MIT License
9
+ Classifier: License :: OSI Approved :: Apache Software License
10
+ License-File: LICENSE-APACHE
11
+ License-File: LICENSE-MIT
10
12
  Summary: Python bindings for pkcore, a high-performance poker analysis library
11
13
  Author-email: folkengine <gaoler@electronicpanopticon.com>
12
- License: GPL-3.0-or-later
14
+ License: MIT OR Apache-2.0
13
15
  Requires-Python: >=3.8
14
16
  Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
15
17
  Project-URL: Bug Tracker, https://github.com/ImperialBower/pkpy/issues
@@ -18,7 +20,8 @@ Project-URL: Repository, https://github.com/ImperialBower/pkpy
18
20
 
19
21
  [![CI](https://github.com/ImperialBower/pkpy/actions/workflows/ci.yml/badge.svg)](https://github.com/ImperialBower/pkpy/actions/workflows/ci.yml)
20
22
  [![PyPI](https://img.shields.io/pypi/v/pkpython.svg)](https://pypi.org/project/pkpython/)
21
- [![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](LICENSE)
23
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE-MIT)
24
+ [![License: Apache 2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE-APACHE)
22
25
 
23
26
  # pkpy
24
27
 
@@ -871,5 +874,19 @@ casino table simulation. Lower-level types (SQLite storage) are not exposed.
871
874
 
872
875
  ## License
873
876
 
874
- GPL-3.0-or-later, matching pkcore.
877
+ Licensed under either of
878
+
879
+ * Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or
880
+ <http://www.apache.org/licenses/LICENSE-2.0>)
881
+ * MIT license ([LICENSE-MIT](LICENSE-MIT) or
882
+ <http://opensource.org/licenses/MIT>)
883
+
884
+ at your option, matching pkcore.
885
+
886
+ ### Contribution
887
+
888
+ Unless you explicitly state otherwise, any contribution intentionally
889
+ submitted for inclusion in the work by you, as defined in the Apache-2.0
890
+ license, shall be dual licensed as above, without any additional terms or
891
+ conditions.
875
892
 
@@ -1,6 +1,7 @@
1
1
  [![CI](https://github.com/ImperialBower/pkpy/actions/workflows/ci.yml/badge.svg)](https://github.com/ImperialBower/pkpy/actions/workflows/ci.yml)
2
2
  [![PyPI](https://img.shields.io/pypi/v/pkpython.svg)](https://pypi.org/project/pkpython/)
3
- [![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](LICENSE)
3
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE-MIT)
4
+ [![License: Apache 2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE-APACHE)
4
5
 
5
6
  # pkpy
6
7
 
@@ -853,4 +854,18 @@ casino table simulation. Lower-level types (SQLite storage) are not exposed.
853
854
 
854
855
  ## License
855
856
 
856
- GPL-3.0-or-later, matching pkcore.
857
+ Licensed under either of
858
+
859
+ * Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or
860
+ <http://www.apache.org/licenses/LICENSE-2.0>)
861
+ * MIT license ([LICENSE-MIT](LICENSE-MIT) or
862
+ <http://opensource.org/licenses/MIT>)
863
+
864
+ at your option, matching pkcore.
865
+
866
+ ### Contribution
867
+
868
+ Unless you explicitly state otherwise, any contribution intentionally
869
+ submitted for inclusion in the work by you, as defined in the Apache-2.0
870
+ license, shall be dual licensed as above, without any additional terms or
871
+ conditions.
@@ -7,7 +7,7 @@ name = "pkpython"
7
7
  dynamic = ["version"]
8
8
  description = "Python bindings for pkcore, a high-performance poker analysis library"
9
9
  readme = "README.md"
10
- license = { text = "GPL-3.0-or-later" }
10
+ license = { text = "MIT OR Apache-2.0" }
11
11
  requires-python = ">=3.8"
12
12
  authors = [
13
13
  { name = "folkengine", email = "gaoler@electronicpanopticon.com"},
@@ -17,7 +17,8 @@ classifiers = [
17
17
  "Programming Language :: Python :: Implementation :: CPython",
18
18
  "Programming Language :: Python :: Implementation :: PyPy",
19
19
  "Topic :: Games/Entertainment",
20
- "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
20
+ "License :: OSI Approved :: MIT License",
21
+ "License :: OSI Approved :: Apache Software License",
21
22
  ]
22
23
 
23
24
  [project.urls]
@@ -31,9 +31,8 @@ use pkcore::casino::dealer::{Dealer as PkDealer, DealerError as PkDealerError};
31
31
  use pkcore::casino::equity::seat_equity::SeatEquity as PkSeatEquity;
32
32
  use pkcore::casino::equity::seatbit::Seatbit as PkSeatbit;
33
33
  use pkcore::casino::game::ForcedBets as PkForcedBets;
34
- use pkcore::casino::player::Player as PkPlayer;
35
34
  use pkcore::casino::state::PlayerState as PkPlayerState;
36
- use pkcore::casino::table_celled::event::TableLog as PkTableLog;
35
+ use pkcore::casino::table::Player as PkPlayer;
37
36
  use pkcore::casino::winnings::{PotWin as PkPotWin, Winnings as PkWinnings};
38
37
  use pkcore::deck::Deck as PkDeck;
39
38
  use pkcore::games::kuhn::{
@@ -2473,7 +2472,7 @@ impl Player {
2473
2472
 
2474
2473
  /// Current chip count (stack only, not including active bet).
2475
2474
  fn chips(&self) -> usize {
2476
- self.0.chips.count()
2475
+ self.0.chips
2477
2476
  }
2478
2477
 
2479
2478
  /// Total chips (stack + any active bet).
@@ -2483,12 +2482,12 @@ impl Player {
2483
2482
 
2484
2483
  /// Chips committed to the current hand.
2485
2484
  fn chips_in_play(&self) -> usize {
2486
- self.0.get_chips_in_play()
2485
+ self.0.chips_in_play
2487
2486
  }
2488
2487
 
2489
2488
  /// Current action state.
2490
2489
  fn state(&self) -> PlayerState {
2491
- PlayerState(self.0.state.get())
2490
+ PlayerState(self.0.state)
2492
2491
  }
2493
2492
 
2494
2493
  fn is_active(&self) -> bool {
@@ -2501,7 +2500,7 @@ impl Player {
2501
2500
  self.0.is_in_hand()
2502
2501
  }
2503
2502
  fn is_ready(&self) -> bool {
2504
- self.0.is_ready()
2503
+ self.0.state.is_ready()
2505
2504
  }
2506
2505
  fn is_out(&self) -> bool {
2507
2506
  self.0.is_out()
@@ -2514,10 +2513,10 @@ impl Player {
2514
2513
  }
2515
2514
 
2516
2515
  fn __str__(&self) -> String {
2517
- format!("{} ({})", self.0.handle, self.0.chips.count())
2516
+ format!("{} ({})", self.0.handle, self.0.chips)
2518
2517
  }
2519
2518
  fn __repr__(&self) -> String {
2520
- format!("Player('{}', {})", self.0.handle, self.0.chips.count())
2519
+ format!("Player('{}', {})", self.0.handle, self.0.chips)
2521
2520
  }
2522
2521
  }
2523
2522
 
@@ -2760,28 +2759,41 @@ impl TableAction {
2760
2759
 
2761
2760
  /// The event log for a poker table — an ordered list of TableAction records.
2762
2761
  #[pyclass(unsendable, name = "TableLog")]
2763
- pub struct TableLog(PkTableLog);
2762
+ pub struct TableLog(Vec<PkTableAction>);
2764
2763
 
2765
2764
  #[pymethods]
2766
2765
  impl TableLog {
2767
2766
  /// All events as a Python list of TableAction objects.
2768
2767
  fn entries(&self) -> Vec<TableAction> {
2769
- self.0.entries().into_iter().map(TableAction).collect()
2768
+ self.0.iter().copied().map(TableAction).collect()
2770
2769
  }
2771
2770
 
2772
2771
  /// The most recent event, or None.
2773
2772
  fn last(&self) -> Option<TableAction> {
2774
- self.0.last().map(TableAction)
2773
+ self.0.last().copied().map(TableAction)
2775
2774
  }
2776
2775
 
2777
2776
  /// The most recent player action (bet/fold/call/raise/check), or None.
2778
2777
  fn last_player_action(&self) -> Option<TableAction> {
2779
- self.0.last_player_action().map(TableAction)
2778
+ self.0
2779
+ .iter()
2780
+ .rev()
2781
+ .find(|action| action.is_player_action())
2782
+ .copied()
2783
+ .map(TableAction)
2780
2784
  }
2781
2785
 
2782
2786
  /// True if the blinds have been posted this hand.
2783
2787
  fn have_posted_blinds(&self) -> bool {
2784
- self.0.have_posted_blinds()
2788
+ let has_small_blind = self
2789
+ .0
2790
+ .iter()
2791
+ .any(|action| matches!(action, PkTableAction::ForcedBetSmallBlind(_, _)));
2792
+ let has_big_blind = self
2793
+ .0
2794
+ .iter()
2795
+ .any(|action| matches!(action, PkTableAction::ForcedBetBigBlind(_, _)));
2796
+ has_small_blind && has_big_blind
2785
2797
  }
2786
2798
 
2787
2799
  /// Number of events in the log.
@@ -2829,7 +2841,7 @@ impl Dealer {
2829
2841
  // ---- Seating ----
2830
2842
 
2831
2843
  /// Seat a player at the next available seat. Returns the seat number.
2832
- fn seat_player(&self, player: &mut Player) -> PyResult<u8> {
2844
+ fn seat_player(&mut self, player: &mut Player) -> PyResult<u8> {
2833
2845
  // Take the player out of the Python wrapper to give ownership to the table
2834
2846
  let p = std::mem::replace(
2835
2847
  &mut player.0,
@@ -2839,7 +2851,7 @@ impl Dealer {
2839
2851
  }
2840
2852
 
2841
2853
  /// Seat a player at a specific seat number (0-indexed).
2842
- fn seat_player_at(&self, player: &mut Player, seat: u8) -> PyResult<()> {
2854
+ fn seat_player_at(&mut self, player: &mut Player, seat: u8) -> PyResult<()> {
2843
2855
  let p = std::mem::replace(
2844
2856
  &mut player.0,
2845
2857
  PkPlayer::new_with_chips("__taken__".into(), 0),
@@ -2848,7 +2860,7 @@ impl Dealer {
2848
2860
  }
2849
2861
 
2850
2862
  /// Remove the player from the given seat. Returns the removed Player.
2851
- fn remove_player(&self, seat: u8) -> PyResult<Player> {
2863
+ fn remove_player(&mut self, seat: u8) -> PyResult<Player> {
2852
2864
  self.0.remove_player(seat).map(Player).map_err(dealer_err)
2853
2865
  }
2854
2866
 
@@ -2872,7 +2884,7 @@ impl Dealer {
2872
2884
  // ---- Player actions ----
2873
2885
 
2874
2886
  /// Player at `seat` bets `amount` chips.
2875
- fn bet(&self, seat: u8, amount: usize) -> PyResult<()> {
2887
+ fn bet(&mut self, seat: u8, amount: usize) -> PyResult<()> {
2876
2888
  use pkcore::casino::dealer::DealerAction;
2877
2889
  self.0
2878
2890
  .act(DealerAction::Bet { seat, amount })
@@ -2880,19 +2892,19 @@ impl Dealer {
2880
2892
  }
2881
2893
 
2882
2894
  /// Player at `seat` calls the current bet.
2883
- fn call(&self, seat: u8) -> PyResult<()> {
2895
+ fn call(&mut self, seat: u8) -> PyResult<()> {
2884
2896
  use pkcore::casino::dealer::DealerAction;
2885
2897
  self.0.act(DealerAction::Call { seat }).map_err(dealer_err)
2886
2898
  }
2887
2899
 
2888
2900
  /// Player at `seat` checks.
2889
- fn check(&self, seat: u8) -> PyResult<()> {
2901
+ fn check(&mut self, seat: u8) -> PyResult<()> {
2890
2902
  use pkcore::casino::dealer::DealerAction;
2891
2903
  self.0.act(DealerAction::Check { seat }).map_err(dealer_err)
2892
2904
  }
2893
2905
 
2894
2906
  /// Player at `seat` raises to `amount` chips.
2895
- fn raise_to(&self, seat: u8, amount: usize) -> PyResult<()> {
2907
+ fn raise_to(&mut self, seat: u8, amount: usize) -> PyResult<()> {
2896
2908
  use pkcore::casino::dealer::DealerAction;
2897
2909
  self.0
2898
2910
  .act(DealerAction::Raise { seat, amount })
@@ -2900,19 +2912,19 @@ impl Dealer {
2900
2912
  }
2901
2913
 
2902
2914
  /// Player at `seat` goes all-in.
2903
- fn all_in(&self, seat: u8) -> PyResult<()> {
2915
+ fn all_in(&mut self, seat: u8) -> PyResult<()> {
2904
2916
  use pkcore::casino::dealer::DealerAction;
2905
2917
  self.0.act(DealerAction::AllIn { seat }).map_err(dealer_err)
2906
2918
  }
2907
2919
 
2908
2920
  /// Player at `seat` folds.
2909
- fn fold(&self, seat: u8) -> PyResult<()> {
2921
+ fn fold(&mut self, seat: u8) -> PyResult<()> {
2910
2922
  use pkcore::casino::dealer::DealerAction;
2911
2923
  self.0.act(DealerAction::Fold { seat }).map_err(dealer_err)
2912
2924
  }
2913
2925
 
2914
2926
  /// Mark player at `seat` as ready to play.
2915
- fn ready(&self, seat: u8) -> PyResult<()> {
2927
+ fn ready(&mut self, seat: u8) -> PyResult<()> {
2916
2928
  use pkcore::casino::dealer::DealerAction;
2917
2929
  self.0.act(DealerAction::Ready { seat }).map_err(dealer_err)
2918
2930
  }
@@ -2946,7 +2958,7 @@ impl Dealer {
2946
2958
 
2947
2959
  /// A copy of the full event log.
2948
2960
  fn event_log(&self) -> TableLog {
2949
- TableLog(self.0.event_log().clone())
2961
+ TableLog(self.0.event_log().to_vec())
2950
2962
  }
2951
2963
 
2952
2964
  fn __repr__(&self) -> String {