Metadata-Version: 2.3
Name: tesuji
Version: 0.1.1
Summary: Codify the elements of the board game Go
Author: Ritsu Kuroda
Author-email: Ritsu Kuroda <ritsu@kuroda.dev>
License: BSD 3-Clause License
         
         Copyright (c) 2026, Ritsu Kuroda
         
         Redistribution and use in source and binary forms, with or without
         modification, are permitted provided that the following conditions are met:
         
         1. Redistributions of source code must retain the above copyright notice, this
            list of conditions and the following disclaimer.
         
         2. Redistributions in binary form must reproduce the above copyright notice,
            this list of conditions and the following disclaimer in the documentation
            and/or other materials provided with the distribution.
         
         3. Neither the name of the copyright holder nor the names of its
            contributors may be used to endorse or promote products derived from
            this software without specific prior written permission.
         
         THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
         AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
         IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
         DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
         FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
         DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
         SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
         CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
         OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
         OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Requires-Dist: numpy==2.5.1
Requires-Dist: aiofiles==25.1.0
Requires-Dist: tornado>=6.5.7
Requires-Dist: pygments>=2.20.0
Requires-Dist: idna>=3.15
Requires-Dist: boto3>=1.43.37
Requires-Dist: scipy>=1.18.0
Maintainer: Ritsu Kuroda
Maintainer-email: Ritsu Kuroda <ritsu@kuroda.dev>
Requires-Python: >=3.13
Project-URL: source, https://github.com/kuroda-dev/tesuji
Project-URL: issues, https://github.com/kuroda-dev/tesuji/issues
Description-Content-Type: text/markdown

> [!NOTE]
> `tesuji` is still in pre-release version. There are still insufficient features, breaking bugs, and unintended exceptions. If you've encountered an issue, see https://github.com/kuroda-dev/tesuji/issues

# Tesuji

Codify the elements of the board game Go.

## Installation

```bash
uv add tesuji
# or
pip install tesuji
```

Requires Python 3.13+.

## Features

### Board

Mutable Go board state with stone tracking, capture resolution, ko detection, and undo.

```python
from tesuji.game import Board, Point

board = Board(size=19)

# Place stones using SGF notation or coordinates
board.move(Point("D4"))
board.move(Point((0,3)))

# Board actions are chainable
board.pass_turn().undo().move(Point("D4"))

```

### Point

Validated board intersection supporting multiple input formats.

```python
from tesuji.game import Point

# Tuple, list, or numpy array
p = Point((0, 0))
p = Point([2, 3])

# SGF notation
p = Point("D6")

# Convert back to SGF
print(p.to_notation())  # "D6"
print(p.to_tuple())     # (5, 3)
```

### SGF Parsing

Parse and generate SGF-style coordinate notation (e.g. `"D6"`, `"Q16"`).

```python
from tesuji.parsers import sgf

row, col = sgf.parse_notation("D6")   # (5, 3)
notation = sgf.to_notation(point)     # "D6"
```

## License

See [LICENSE](LICENSE).
