Metadata-Version: 2.4
Name: chess-result-analyzer-ollama
Version: 0.1.1
Summary: OCR-first chess screenshot analyzer with optional Ollama fallback
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: numpy>=1.24
Requires-Dist: opencv-python>=4.8
Requires-Dist: pillow>=10.0
Requires-Dist: pytesseract>=0.3.10
Requires-Dist: requests>=2.31

# Chess Result Analyzer Ollama

OCR-first chess screenshot analysis with an optional Ollama fallback.

## Features

- OCR-first flow that skips Ollama when OCR confidence is already high
- Optional Ollama fallback for uncertain screenshots
- Chess.com mobile and desktop result parsing
- Importable Python API
- Desktop GUI uploader
- CLI entrypoints

## Install

```bash
pip install chess-result-analyzer-ollama
```

You also need the native Tesseract executable installed on your machine.

## Python Usage

```python
from chess_result_analyzer import OllamaSettings, analyze_chess_result

result = analyze_chess_result(
    "result.png",
    username="isco-olad",
    ollama=OllamaSettings(
        model="gemma3:4b",
        base_url="http://127.0.0.1:11434",
        mode="fallback",
    ),
)

print(result["winner"], result["winner_color"])
print(result["ollama_decision"], result["ollama_reason"])
```

## Hosted Ollama

```bash
export OLLAMA_BASE_URL="https://ollama.com"
export OLLAMA_API_KEY="your-key"
```

## CLI

```bash
chess-analyze --image result.png --username isco-olad
chess-analyze --image result.png --use-ollama --ollama-model gemma3:4b
chess-analyze-gui
```
