Skip to main content
PyPI Docs Downloads Tests Status

Introduction

Generate a GIF of a chess game from a PGN with optional:

  • Analysis bar

  • Analysis chart

  • Numerical Annotation Glyphs (NAGs)

  • Move and check arrows

  • PGN module to add engine evaluations and calculate ACPL

    Details on breaking changes in the 1.0.0 release

    This release brings new features such as headers with player names, taken pieces and clocks, and Numeric Annotation Glyphs (NAGs).

    The module was also restructured for easier usage and extensibility. Code using version 0.2.0 and earlier will not work with version 1.0.0 - minor changes will be required to get back up and running again.

    Please see the examples and documentation for details.

Demo

GIF with all features enabled

import chess
import chess.engine
import chess.pgn
import io
from gifpgn import CreateGifFromPGN, PieceTheme, BoardThemes
from gifpgn.utils import PGN

pgn_string = ...
game = chess.pgn.read_game(io.StringIO(pgn_string))
if not PGN(game).has_analysis():
    with chess.engine.SimpleEngine.popen_uci("/path/to/stockfish") as engine:
        game = PGN(game).add_analysis(engine, chess.engine.Limit(depth=18))
g = CreateGifFromPGN(game)
g.piece_theme = PieceTheme.ALPHA
g.square_colors = BoardThemes.BLUE
g.enable_arrows()
g.add_headers(height=20)
g.add_analysis_bar()
g.add_analysis_graph()
g.enable_nags()
gif = g.generate("test_gif.gif")
https://github.com/prozn/gifpgn/blob/master/docs/images/all_features.gif?raw=true

Small GIF with no analysis

import chess.pgn
import io
from from gifpgn import CreateGifFromPGN, PieceTheme, BoardThemes

pgn_string = ...
game = chess.pgn.read_game(io.StringIO(pgn_string))
g = CreateGifFromPGN(game)
g.board_size = 240
g.piece_theme = PieceTheme.CASES
g.square_colors = BoardThemes.GREEN
g.generate("test_small_gif.gif")
https://github.com/prozn/gifpgn/blob/master/docs/images/small_gif.gif?raw=true

Piece and Board Themes

Alpha

Blue

https://github.com/prozn/gifpgn/blob/master/docs/images/alpha.png?raw=true

Cases

Green

https://github.com/prozn/gifpgn/blob/master/docs/images/cases.png?raw=true

Maya

Brown

https://github.com/prozn/gifpgn/blob/master/docs/images/maya.png?raw=true

Regular

Purple

https://github.com/prozn/gifpgn/blob/master/docs/images/regular.png?raw=true

Installing

Install with pip:

pip install gifpgn

Documentation

View on Read The Docs

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gifpgn-1.2.0.tar.gz (391.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gifpgn-1.2.0-py3-none-any.whl (401.6 kB view details)

Uploaded Python 3

File details

Details for the file gifpgn-1.2.0.tar.gz.

File metadata

  • Download URL: gifpgn-1.2.0.tar.gz
  • Upload date:
  • Size: 391.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.9 {"installer":{"name":"uv","version":"0.12.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for gifpgn-1.2.0.tar.gz
Algorithm Hash digest
SHA256 22897f5d2d528032b91af1b1c9a8af1d29ce0bb744b4d505fe119c7654c7b802
MD5 b4f9c52d2cb8502a9b77c9a8d1de91b1
BLAKE2b-256 572d35b02e44027f3c69811be35d0b5d1605e278a519290c6c8dc1aeb5496778

See more details on using hashes here.

File details

Details for the file gifpgn-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: gifpgn-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 401.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.9 {"installer":{"name":"uv","version":"0.12.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for gifpgn-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dcd39036e3ab7da49c9a9b97a2d899b5483bbef577d2603157c54854dafe7e30
MD5 75516afbfd2e85f0548ab798d8fdfdfe
BLAKE2b-256 532aef4d31553d80172e5a9f4760705739ea2723360b9b16748973926eb06ee7

See more details on using hashes here.

Release history Release notifications | RSS feed

1.2.1

2 files

This release

1.2.0 This release

2 files

1.1.1

2 files

1.1.0

2 files

1.0.0

2 files

0.2.0

2 files

0.1.2

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page