Python port of okey-solver-ts and okey-vision-ts
Project description
okey-solver-py
Python library for solving Okey & Rummikub tile arrangements and processing board layouts.
Features
- Backtracking Solver: Optimal arrangement solver for Okey / Rummikub games.
- Pairs/Double Play: Find identical pairs.
- Extensible Vision Engine: Process frames natively with numpy arrays (OpenCV), PIL, base64 strings, bytes, and paths.
- Provider Support: Native local YOLO (
ultralytics) and cloud Roboflow API implementations.
Installation
pip install okey-solver-py
Quick Start
Basic Solver Arrangement
from okey_solver import SolverEngine, Tile, TileColor
tiles = [
Tile(id="r5", color=TileColor.RED, value=5),
Tile(id="r6", color=TileColor.RED, value=6),
Tile(id="r7", color=TileColor.RED, value=7),
]
result = SolverEngine.findBestArrangement(tiles)
print(result.totalScore)
With Roboflow Provider
from okey_vision import RoboflowProvider, VisionSolverEngine
provider = RoboflowProvider(
api_key="your_api_key",
model_id="rummikub-5bldr",
model_version=1
)
engine = VisionSolverEngine(provider)
result = engine.analyze_frame("image_path.jpg")
print(result["tiles"])
print(result["arrangement"])
With Local YOLO Model
from okey_vision import LocalYoloProvider, VisionSolverEngine
provider = LocalYoloProvider(
model_path="./models/yolov8_best.pt"
)
engine = VisionSolverEngine(provider)
result = engine.analyze_frame("board_layout.jpg")
print(result["arrangement"])
Extended Documentation
For details on architecture, rules, and APIs:
- 🏗 Architecture & Flow - Details on pipeline stages, frame adapters, and observers.
- 📜 Game Rules Reference - Okey rules, 12-13-1 circular runs, joker and false okey logic.
- 💻 CLI Usage Guide - Guide to running
okey-solveandokey-visionterminal applications. - 🤖 Telegram Bot Demo - Telegram Bot server example integrating image detection and layout solving.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file okey_solver_py-0.3.0.tar.gz.
File metadata
- Download URL: okey_solver_py-0.3.0.tar.gz
- Upload date:
- Size: 17.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b30bcb5d9c013b26885955308da739d48c4e24104cd4824d49b99862df39aa6c
|
|
| MD5 |
ba079f0e688943598dfeff82fd1b64e6
|
|
| BLAKE2b-256 |
6d56b17c511a41656660dc215af25b92298dfd5b117bb91d0ea2c998504a04fe
|
Provenance
The following attestation bundles were made for okey_solver_py-0.3.0.tar.gz:
Publisher:
release.yml on AtaCanYmc/okey-solver-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
okey_solver_py-0.3.0.tar.gz -
Subject digest:
b30bcb5d9c013b26885955308da739d48c4e24104cd4824d49b99862df39aa6c - Sigstore transparency entry: 2073069238
- Sigstore integration time:
-
Permalink:
AtaCanYmc/okey-solver-py@3ca8e9bf98f86d4fef4569bf596f5c6105923c24 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/AtaCanYmc
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@3ca8e9bf98f86d4fef4569bf596f5c6105923c24 -
Trigger Event:
push
-
Statement type:
File details
Details for the file okey_solver_py-0.3.0-py3-none-any.whl.
File metadata
- Download URL: okey_solver_py-0.3.0-py3-none-any.whl
- Upload date:
- Size: 23.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
62d8f4717d3c3218091e6b01baba3e9c260408ce9157ded6e5a2bca13536ca2c
|
|
| MD5 |
4fd2ba3a6f98211020e133580944cdcd
|
|
| BLAKE2b-256 |
c69f6f02dd06f68c67c3a0a986cc9a5ea8310719122686c97f15a2168b4cd907
|
Provenance
The following attestation bundles were made for okey_solver_py-0.3.0-py3-none-any.whl:
Publisher:
release.yml on AtaCanYmc/okey-solver-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
okey_solver_py-0.3.0-py3-none-any.whl -
Subject digest:
62d8f4717d3c3218091e6b01baba3e9c260408ce9157ded6e5a2bca13536ca2c - Sigstore transparency entry: 2073069265
- Sigstore integration time:
-
Permalink:
AtaCanYmc/okey-solver-py@3ca8e9bf98f86d4fef4569bf596f5c6105923c24 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/AtaCanYmc
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@3ca8e9bf98f86d4fef4569bf596f5c6105923c24 -
Trigger Event:
push
-
Statement type: