Skip to main content

A Pythonic wargame engine for Guy Debord's Le Jeu de la Guerre

Project description

Pykrieg

PyPI Version Documentation License

A Pythonic wargame engine for Guy Debord's Le Jeu de la Guerre (A Game of War).

About

Pykrieg is a Python library that implements the complex rules of Guy Debord's strategic tabletop game, providing a clean, extensible API for developers to build custom interfaces, AI opponents, and analysis tools. The project is inspired by the successful python-chess library and follows similar design principles.

Features

  • Complete Game Engine: Full implementation of Debord's strategic game rules
  • Clean API: Intuitive Pythonic interface modeled after python-chess
  • Extensible Design: Easy to create custom variants, unit types, and victory conditions
  • Format Support: Game record and position formats for saving/sharing games
  • Console Interface: Interactive terminal-based gameplay (v0.1.5)
  • Well-Tested: Comprehensive test suite with 89%+ code coverage

Installation

pip install pykrieg

For console interface with mouse support:

pip install pykrieg[console]

Quick Start

Console Interface (Casual Players)

Launch the interactive console game:

python -m pykrieg.console

Play using simple commands:

  • move 5,10 6,10 - Move a unit
  • attack 5,12 - Attack a target
  • pass - Skip attack phase
  • end - End turn
  • help - Show all commands

Python API (Developers)

from pykrieg import Board

# Create a board
board = Board()

# Add units
board.create_and_place_unit(5, 10, 'INFANTRY', 'NORTH')

# Move a unit
board.make_turn_move(5, 10, 6, 10)

# Attack
board.switch_to_battle_phase()
result = board.make_turn_attack(1, 12)

# End turn
board.end_turn()

Documentation

Contributing

We welcome contributions! Please see CONTRIBUTING.md for guidelines.

Donations

If you like the project and want to support future development, consider donating!

Donate with PayPal

License

This project is licensed under the GNU General Public License v3.0 - see LICENSE for details.

The GPL v3 license ensures that:

  • The software remains free for all users
  • Derivative works must be shared under the same license (copyleft)
  • Commercial use is prohibited (requires separate commercial license)
  • Users have the freedom to study, modify, and distribute the software

Project details


Download files

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

Source Distribution

pykrieg-0.1.5.tar.gz (102.1 kB view details)

Uploaded Source

Built Distribution

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

pykrieg-0.1.5-py3-none-any.whl (62.5 kB view details)

Uploaded Python 3

File details

Details for the file pykrieg-0.1.5.tar.gz.

File metadata

  • Download URL: pykrieg-0.1.5.tar.gz
  • Upload date:
  • Size: 102.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.19

File hashes

Hashes for pykrieg-0.1.5.tar.gz
Algorithm Hash digest
SHA256 26fb9a11a2f01184274e0c11dce2533c78867e04670fafd328c6afbd28dcb2e5
MD5 dcb23b28b5f2f8eada5341645fd1d4f0
BLAKE2b-256 a5ccff1ee34011ece307061d9c23c11eb396c320aa79ae05a0dbcf2e5a15bc8e

See more details on using hashes here.

File details

Details for the file pykrieg-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: pykrieg-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 62.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.19

File hashes

Hashes for pykrieg-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 5000d9f1bbccbf7bd66878f8ae44c03501f7d7b867d5ce11e71b42cd61bdf717
MD5 f30add89287905a0d874b49a874faad9
BLAKE2b-256 46a6c46176905deaedb9cbb4ce5d84ce702322e172a1260050940f93b083d635

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page