cube-python 0.4.0__tar.gz → 0.5.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.
@@ -1,14 +1,13 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cube-python
3
- Version: 0.4.0
3
+ Version: 0.5.1
4
4
  Summary: Python binding for Cube C++ library
5
5
  Author-email: coshz <fsinhx@gmail.com>
6
- License: MIT
7
- Project-URL: Documentation, https://github.com/coshz/cube/tree/master/bindings/python#readme
6
+ License-Expression: MIT
7
+ Project-URL: Documentation, https://github.com/coshz/cube/tree/HEAD/bindings/python#readme
8
8
  Project-URL: Source, https://github.com/coshz/cube
9
9
  Project-URL: Bug Tracker, https://github.com/coshz/cube/issues
10
10
  Keywords: game,rubiks-cube,bindings
11
- Classifier: License :: OSI Approved :: MIT License
12
11
  Classifier: Programming Language :: Python :: 3
13
12
  Classifier: Programming Language :: C++
14
13
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
@@ -20,8 +19,8 @@ Dynamic: license-file
20
19
  # cube-python
21
20
 
22
21
  [![PyPI version](https://img.shields.io/pypi/v/cube-python.svg)](https://pypi.org/project/cube-python/)
23
- [![License](https://img.shields.io/github/license/yourusername/cube)](https://github.com/yourusername/cube/blob/main/LICENSE)
24
- [![GitHub](https://img.shields.io/badge/github-coshz%2Fcube-blue?logo=github)](https://github.com/coshz/cube/tree/master/bindings/python)
22
+ [![PyPI License](https://img.shields.io/pypi/l/cube-python.svg)](https://pypi.org/project/cube-python/)
23
+ [![GitHub](https://img.shields.io/badge/github-coshz%2Fcube-blue?logo=github)](https://github.com/coshz/cube/tree/HEAD/bindings/python)
25
24
 
26
25
 
27
26
  High-performance Rubik's Cube solver Python bindings powered by C/C++ FFI.
@@ -37,7 +36,7 @@ pip install cube-python
37
36
  ## Quickstart
38
37
 
39
38
  ```python
40
- iimport pycube
39
+ import pycube
41
40
  from pycube import SolveError
42
41
 
43
42
  # Default solved cube string representation
@@ -49,7 +48,7 @@ scrambled = pycube.facecube("U F U' L2 R L' D2 B")
49
48
  if pycube.solvable(scrambled):
50
49
  try:
51
50
  # Find solution sequence
52
- solution = pycube.solve(scrambled, step=30, best=True)
51
+ solution = pycube.solve(scrambled,good=22)
53
52
  print(f"Solution: {solution}")
54
53
 
55
54
  # Apply solution to verify end state
@@ -64,24 +63,26 @@ if pycube.solvable(scrambled):
64
63
 
65
64
  ```python
66
65
  import pycube
67
- from pycube import SolveError, CUBE_ID
66
+ from pycube import SolveError, CUBE_ID, PermFormat
68
67
  ```
69
68
 
70
69
  ### Functions
71
70
 
72
71
  | Function | Description |
73
72
  | :--- | :--- |
74
- | `solve(src, tgt=CUBE_ID, step=30, best=False)` | Solves the cube state string `src`. Returns solution string or raises `SolveError`. |
75
- | `facecube(maneuver, cube=CUBE_ID)` | Applies move sequence (e.g., `"U F U' L2"`) to a cube state and returns the new state. |
73
+ | `cube_init(use_symmetry=True,table_dir="")` | use symmetric pruning tables and customized table directory. |
74
+ | `solve(src,tgt=CUBE_ID,good=22)` | Solve cube state `src`; stops as soon as a solution <= `good` moves is found. Returns solution string or raises `SolveError`. |
75
+ | `facecube(maneuver,cube=CUBE_ID)` | Applies move sequence (e.g., `"U F U' L2"`) to a cube state and returns the new state. |
76
76
  | `solvable(cube)` | Returns `True` if the 54-character state string is physically solvable. |
77
- | `permutation(ms, fmt=2)` | Returns a permutation representation for a move sequence or state. |
77
+ | `permutation(ms_or_cube,fmt=PermFormat.Cycle)` | Returns a permutation representation for a move sequence or state. |
78
78
 
79
79
  ### Constants & Exceptions
80
80
 
81
81
  | Name | Type | Description |
82
82
  | :--- | :--- | :--- |
83
- | `CUBE_ID` | `str` | Constant representing the standard solved state (`"UUUUUUUUURRRRRRRRRFFFFFFFFFDDDDDDDDDLLLLLLLLLBBBBBBBBB"`). |
84
- | `SolveError` | `Exception` | Raised when the state is invalid, unsolvable, or exceeds search step limits. |
83
+ | `CUBE_ID` | `str` | Constant representing the standard solved state `UUUUUUUUURRRRRRRRRFFFFFFFFFDDDDDDDDDLLLLLLLLLBBBBBBBBB`. |
84
+ | `PermFormat` | `IntEnum` | Permutation output format. Members: `Face`,`Cubie`,`Cycle`. Defaults to `Cycle`. |
85
+ | `SolveError` | `Exception` | Raised when the state is invalid or unsolvable. |
85
86
 
86
87
  ## 📄 License
87
88
 
@@ -1,8 +1,8 @@
1
1
  # cube-python
2
2
 
3
3
  [![PyPI version](https://img.shields.io/pypi/v/cube-python.svg)](https://pypi.org/project/cube-python/)
4
- [![License](https://img.shields.io/github/license/yourusername/cube)](https://github.com/yourusername/cube/blob/main/LICENSE)
5
- [![GitHub](https://img.shields.io/badge/github-coshz%2Fcube-blue?logo=github)](https://github.com/coshz/cube/tree/master/bindings/python)
4
+ [![PyPI License](https://img.shields.io/pypi/l/cube-python.svg)](https://pypi.org/project/cube-python/)
5
+ [![GitHub](https://img.shields.io/badge/github-coshz%2Fcube-blue?logo=github)](https://github.com/coshz/cube/tree/HEAD/bindings/python)
6
6
 
7
7
 
8
8
  High-performance Rubik's Cube solver Python bindings powered by C/C++ FFI.
@@ -18,7 +18,7 @@ pip install cube-python
18
18
  ## Quickstart
19
19
 
20
20
  ```python
21
- iimport pycube
21
+ import pycube
22
22
  from pycube import SolveError
23
23
 
24
24
  # Default solved cube string representation
@@ -30,7 +30,7 @@ scrambled = pycube.facecube("U F U' L2 R L' D2 B")
30
30
  if pycube.solvable(scrambled):
31
31
  try:
32
32
  # Find solution sequence
33
- solution = pycube.solve(scrambled, step=30, best=True)
33
+ solution = pycube.solve(scrambled,good=22)
34
34
  print(f"Solution: {solution}")
35
35
 
36
36
  # Apply solution to verify end state
@@ -45,24 +45,26 @@ if pycube.solvable(scrambled):
45
45
 
46
46
  ```python
47
47
  import pycube
48
- from pycube import SolveError, CUBE_ID
48
+ from pycube import SolveError, CUBE_ID, PermFormat
49
49
  ```
50
50
 
51
51
  ### Functions
52
52
 
53
53
  | Function | Description |
54
54
  | :--- | :--- |
55
- | `solve(src, tgt=CUBE_ID, step=30, best=False)` | Solves the cube state string `src`. Returns solution string or raises `SolveError`. |
56
- | `facecube(maneuver, cube=CUBE_ID)` | Applies move sequence (e.g., `"U F U' L2"`) to a cube state and returns the new state. |
55
+ | `cube_init(use_symmetry=True,table_dir="")` | use symmetric pruning tables and customized table directory. |
56
+ | `solve(src,tgt=CUBE_ID,good=22)` | Solve cube state `src`; stops as soon as a solution <= `good` moves is found. Returns solution string or raises `SolveError`. |
57
+ | `facecube(maneuver,cube=CUBE_ID)` | Applies move sequence (e.g., `"U F U' L2"`) to a cube state and returns the new state. |
57
58
  | `solvable(cube)` | Returns `True` if the 54-character state string is physically solvable. |
58
- | `permutation(ms, fmt=2)` | Returns a permutation representation for a move sequence or state. |
59
+ | `permutation(ms_or_cube,fmt=PermFormat.Cycle)` | Returns a permutation representation for a move sequence or state. |
59
60
 
60
61
  ### Constants & Exceptions
61
62
 
62
63
  | Name | Type | Description |
63
64
  | :--- | :--- | :--- |
64
- | `CUBE_ID` | `str` | Constant representing the standard solved state (`"UUUUUUUUURRRRRRRRRFFFFFFFFFDDDDDDDDDLLLLLLLLLBBBBBBBBB"`). |
65
- | `SolveError` | `Exception` | Raised when the state is invalid, unsolvable, or exceeds search step limits. |
65
+ | `CUBE_ID` | `str` | Constant representing the standard solved state `UUUUUUUUURRRRRRRRRFFFFFFFFFDDDDDDDDDLLLLLLLLLBBBBBBBBB`. |
66
+ | `PermFormat` | `IntEnum` | Permutation output format. Members: `Face`,`Cubie`,`Cycle`. Defaults to `Cycle`. |
67
+ | `SolveError` | `Exception` | Raised when the state is invalid or unsolvable. |
66
68
 
67
69
  ## 📄 License
68
70
 
@@ -1,14 +1,13 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cube-python
3
- Version: 0.4.0
3
+ Version: 0.5.1
4
4
  Summary: Python binding for Cube C++ library
5
5
  Author-email: coshz <fsinhx@gmail.com>
6
- License: MIT
7
- Project-URL: Documentation, https://github.com/coshz/cube/tree/master/bindings/python#readme
6
+ License-Expression: MIT
7
+ Project-URL: Documentation, https://github.com/coshz/cube/tree/HEAD/bindings/python#readme
8
8
  Project-URL: Source, https://github.com/coshz/cube
9
9
  Project-URL: Bug Tracker, https://github.com/coshz/cube/issues
10
10
  Keywords: game,rubiks-cube,bindings
11
- Classifier: License :: OSI Approved :: MIT License
12
11
  Classifier: Programming Language :: Python :: 3
13
12
  Classifier: Programming Language :: C++
14
13
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
@@ -20,8 +19,8 @@ Dynamic: license-file
20
19
  # cube-python
21
20
 
22
21
  [![PyPI version](https://img.shields.io/pypi/v/cube-python.svg)](https://pypi.org/project/cube-python/)
23
- [![License](https://img.shields.io/github/license/yourusername/cube)](https://github.com/yourusername/cube/blob/main/LICENSE)
24
- [![GitHub](https://img.shields.io/badge/github-coshz%2Fcube-blue?logo=github)](https://github.com/coshz/cube/tree/master/bindings/python)
22
+ [![PyPI License](https://img.shields.io/pypi/l/cube-python.svg)](https://pypi.org/project/cube-python/)
23
+ [![GitHub](https://img.shields.io/badge/github-coshz%2Fcube-blue?logo=github)](https://github.com/coshz/cube/tree/HEAD/bindings/python)
25
24
 
26
25
 
27
26
  High-performance Rubik's Cube solver Python bindings powered by C/C++ FFI.
@@ -37,7 +36,7 @@ pip install cube-python
37
36
  ## Quickstart
38
37
 
39
38
  ```python
40
- iimport pycube
39
+ import pycube
41
40
  from pycube import SolveError
42
41
 
43
42
  # Default solved cube string representation
@@ -49,7 +48,7 @@ scrambled = pycube.facecube("U F U' L2 R L' D2 B")
49
48
  if pycube.solvable(scrambled):
50
49
  try:
51
50
  # Find solution sequence
52
- solution = pycube.solve(scrambled, step=30, best=True)
51
+ solution = pycube.solve(scrambled,good=22)
53
52
  print(f"Solution: {solution}")
54
53
 
55
54
  # Apply solution to verify end state
@@ -64,24 +63,26 @@ if pycube.solvable(scrambled):
64
63
 
65
64
  ```python
66
65
  import pycube
67
- from pycube import SolveError, CUBE_ID
66
+ from pycube import SolveError, CUBE_ID, PermFormat
68
67
  ```
69
68
 
70
69
  ### Functions
71
70
 
72
71
  | Function | Description |
73
72
  | :--- | :--- |
74
- | `solve(src, tgt=CUBE_ID, step=30, best=False)` | Solves the cube state string `src`. Returns solution string or raises `SolveError`. |
75
- | `facecube(maneuver, cube=CUBE_ID)` | Applies move sequence (e.g., `"U F U' L2"`) to a cube state and returns the new state. |
73
+ | `cube_init(use_symmetry=True,table_dir="")` | use symmetric pruning tables and customized table directory. |
74
+ | `solve(src,tgt=CUBE_ID,good=22)` | Solve cube state `src`; stops as soon as a solution <= `good` moves is found. Returns solution string or raises `SolveError`. |
75
+ | `facecube(maneuver,cube=CUBE_ID)` | Applies move sequence (e.g., `"U F U' L2"`) to a cube state and returns the new state. |
76
76
  | `solvable(cube)` | Returns `True` if the 54-character state string is physically solvable. |
77
- | `permutation(ms, fmt=2)` | Returns a permutation representation for a move sequence or state. |
77
+ | `permutation(ms_or_cube,fmt=PermFormat.Cycle)` | Returns a permutation representation for a move sequence or state. |
78
78
 
79
79
  ### Constants & Exceptions
80
80
 
81
81
  | Name | Type | Description |
82
82
  | :--- | :--- | :--- |
83
- | `CUBE_ID` | `str` | Constant representing the standard solved state (`"UUUUUUUUURRRRRRRRRFFFFFFFFFDDDDDDDDDLLLLLLLLLBBBBBBBBB"`). |
84
- | `SolveError` | `Exception` | Raised when the state is invalid, unsolvable, or exceeds search step limits. |
83
+ | `CUBE_ID` | `str` | Constant representing the standard solved state `UUUUUUUUURRRRRRRRRFFFFFFFFFDDDDDDDDDLLLLLLLLLBBBBBBBBB`. |
84
+ | `PermFormat` | `IntEnum` | Permutation output format. Members: `Face`,`Cubie`,`Cycle`. Defaults to `Cycle`. |
85
+ | `SolveError` | `Exception` | Raised when the state is invalid or unsolvable. |
85
86
 
86
87
  ## 📄 License
87
88
 
@@ -10,5 +10,4 @@ cxx/cube_amalg.min.cpp
10
10
  pycube/__init__.py
11
11
  pycube/_exceptions.py
12
12
  pycube/_ffi.py
13
- test/test.2.py
14
- test/test_cube.py
13
+ test/test.2.py