Metadata-Version: 2.3
Name: rubiks-toolkit
Version: 0.1.1
Summary: Represent, manipulate, analyze, scramble, and solve 2x2 and 3x3 Rubik's cubes
Keywords: rubik,rubiks-cube,cube,algorithm,solver
Author: Davi Reis Furtado
Author-email: Davi Reis Furtado <davifurtado.r@gmail.com>
License: MIT License
         
         Copyright (c) 2021 Real Python
         
         Permission is hereby granted, free of charge, to any person obtaining a copy
         of this software and associated documentation files (the "Software"), to deal
         in the Software without restriction, including without limitation the rights
         to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
         copies of the Software, and to permit persons to whom the Software is
         furnished to do so, subject to the following conditions:
         
         The above copyright notice and this permission notice shall be included in all
         copies or substantial portions of the Software.
         
         THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
         IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
         FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
         AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
         LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
         OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
         SOFTWARE.
Requires-Python: >=3.13
Project-URL: Homepage, https://davi-furtado.github.io/rubiks-toolkit
Project-URL: Documentation, https://davi-furtado.github.io/rubiks-toolkit
Project-URL: Repository, https://github.com/davi-furtado/rubiks-toolkit
Project-URL: Issues, https://github.com/davi-furtado/rubiks-toolkit/issues
Description-Content-Type: text/markdown

<div align="center">
  <h1>rubiks-toolkit</h1>

  <img alt="Python 3.13+" src="https://img.shields.io/badge/python-3.13%2B-3670A0?logo=python&logoColor=ffdd54">
  <a href="https://pypi.org/project/rubiks-toolkit/"><img alt="PyPI" src="https://img.shields.io/pypi/v/rubiks-toolkit?logo=pypi&logoColor=white"></a>
  
  <br>

  <img alt="MIT license" src="https://img.shields.io/badge/license-MIT-green">
  <a href="https://davi-furtado.github.io/rubiks-toolkit"><img alt="Documentation" src="https://img.shields.io/website?url=https://davi-furtado.github.io/rubiks-toolkit"></a>
</div>

<p align="center"><i>Represent, manipulate, analyze, scramble, and solve 2x2 and 3x3 Rubik's cubes in Python.</i></p>

## Documentation

Read the complete documentation at <https://davi-furtado.github.io/rubiks-toolkit>.
The distribution is named `rubiks-toolkit`, while the Python package is imported
as `rubiks`.

## Installation

```bash
uv add rubiks-toolkit
```

Or with pip:

```bash
pip install rubiks-toolkit
```

## Examples

```python
from rubiks import Algorithm, Cube, solve

cube = Cube(size=3)
cube.execute(Algorithm.from_string("R U R' U'"))
cube.execute(solve(cube))

assert cube.is_solved()
```

Generate and inspect a scramble:

```python
from rubiks import Cube, generate_scramble

cube = Cube(size=2)
scramble = generate_scramble(size=2, length=10)
cube.execute(scramble)

print(scramble)
print(cube.state)
```

The package also exposes `Move`, `Algorithm`, `Solver`, `generate_scramble`,
`is_solved`, and the complete public `Cube.state` mapping. `Algorithm` is
independent of cube size; size-specific move validation happens when moves are
executed by `Cube`. More examples are available in the
[documentation](https://davi-furtado.github.io/rubiks-toolkit/examples/).

Run the complete API demonstration from the repository root:

```bash
uv run python demonstration.py
```

## Supported notation

- Basic faces: `U D L R F B`
- Wide moves on 3x3: `Uw Dw Lw Rw Fw Bw`
- Slices on 3x3: `M E S`
- Whole-cube rotations: `x y z`
- Modifiers: `'` and `2`

## Releases

### 0.1.1

This release refines the public API:

- Removed the cube `size` parameter from `Algorithm`.
- Made `generate_scramble(size=...)` optional; omitting it uses the 3x3 move set.
- Moved cube-size move restrictions to `Cube` execution.
- Simplified `Solver` to IDDFS only.
- Fixed `Algorithm(None)` to create an empty algorithm as documented.

### 0.1.0

First public release of `rubiks-toolkit`. It provides:

- Sticker-based `Cube` models for 2x2 and 3x3 cubes.
- Move notation, algorithms, inverses, optimization, and analysis.
- Scramble generation and a solver.
- API documentation generated from Python docstrings.

## Development

```bash
uv sync
uv run python demonstration.py
uv run pytest
uv run mkdocs serve
```

The documentation site is built with MkDocs and published at
<https://davi-furtado.github.io/rubiks-toolkit>.
