chevy-0.2.2


توضیحات

Chess position Evaluation via hand-crafted features
ویژگی مقدار
سیستم عامل -
نام فایل chevy-0.2.2
نام chevy
نسخه کتابخانه 0.2.2
نگهدارنده []
ایمیل نگهدارنده []
نویسنده int8
ایمیل نویسنده -
آدرس صفحه اصلی https://github.com/int8/chevy
آدرس اینترنتی https://pypi.org/project/chevy/
مجوز -
## Simple framework turning fen into set of hand-crafted chess position features ### Installation To install please run ```shell pip install chevy ``` ### Basic usage King safety features ```python import chess from chevy.features import KingSafety # https://lichess.org/analysis/2r3k1/7R/6PK/6P1/2Q5/8/8/8_b_-_-_6_73 fen = "2r3k1/7R/6PK/6P1/2Q5/8/8/8 b - - 6 73" board = chess.Board(fen) king_safety = KingSafety(board, color=chess.WHITE) print(f"{king_safety.king_mobility=}") print(f"{king_safety.castling_rights=}") print(f"{king_safety.king_centrality=}") print(f"{king_safety.checked=}") print(f"{king_safety.king_attackers_looking_at_ring_1=}") print(f"{king_safety.king_defenders_at_ring_1=}") # + more ``` Pawn structure features ```python import chess from chevy.features import PawnStructure # https://lichess.org/editor/5kr1/4pp1p/1Q2q3/1PBP2p1/2P3P1/p7/4P3/1R2K1B1_w_-_-_0_19 fen = "5kr1/4pp1p/1Q2q3/1PBP2p1/2P3P1/p7/4P3/1R2K1B1 w - - 0 19" board = chess.Board(fen) pawn_structure = PawnStructure(board, color=chess.WHITE) print(f"{pawn_structure.passed_pawns=}") print(f"{pawn_structure.isolated_pawns=}") print(f"{pawn_structure.blocked_pawns=}") print(f"{pawn_structure.central_pawns=}") ``` Other common features ```python import chess from chevy.features import BoardFeatures # https://lichess.org/editor/5kr1/4pp1p/1Q2q3/1PBP2p1/2P3P1/p7/4P3/1R2K1B1_w_-_-_0_19 fen = "5kr1/4pp1p/1Q2q3/1PBP2p1/2P3P1/p7/4P3/1R2K1B1 w - - 0 19" board = chess.Board(fen) board_features = BoardFeatures(board, color=chess.WHITE) print(f"{board_features.bishop_pair=}") print(f"{board_features.fianchetto_queen=}") print(f"{board_features.fianchetto_king=}") print(f"{board_features.queens_mobility=}") print(f"{board_features.open_files_rooks_count=}") print(f"{board_features.connected_rooks=}") print(f"{board_features.connectivity=}") # + more ``` To run tests: ```shell pytest chevy/tests ```


نیازمندی

مقدار نام
>=1.999,<2.0 python-chess
>=1.22.3,<2.0.0 numpy
>=1.8.0,<2.0.0 scipy
>=1.0.4,<2.0.0 msgpack
>=5.2.0,<6.0.0 cachetools


زبان مورد نیاز

مقدار نام
>=3.7,<3.11 Python


نحوه نصب


نصب پکیج whl chevy-0.2.2:

    pip install chevy-0.2.2.whl


نصب پکیج tar.gz chevy-0.2.2:

    pip install chevy-0.2.2.tar.gz