Skip to main content

J-Chess: Play chess in the console!

Checked with mypy linting: pylint code style: black Imports: isort

A simple project allowing you to play chess within your console.

Usage

Requires python 3.10 or later. The package is available on pypi so to play simply install with pip install jchess and then play with jchess or python -m jchess.

The project was developed primarily alongside powershell but the project should be compatible with generic Windows and Linux consoles.

If you have any feedback please feel free to share it!

Features

J-Chess fully implements chess logic and rules - including castling, en-passant, promotion and check/checkmate.

It is primarily designed to be played by 2 people at the same computer but it does feature a "VS Dumb Bot" mode where you can play against an opponent who's moves are random.

For demonstration purposes there is also a "Two Dumb Bots" mode where an entire game is played with no user input.

Motivation

This was simply a project to better familiarize myself with programming in python and other lifecycle practices & tools.

I was able to practice using useful tools like git, github and wsl as well as useful concepts including OOP programming patterns, regular expressions, testing, documentation, packaging and managing dependencies.

The python tooling modules I used were mypy, pylint, black, isort, pytest, pydocstyle and coverage.

Python code features I experimented with and used in the final project include dataclasses, generators, type annotations and context managers.

Scope

The goal of the project was to practice pure python programming so by design there are minimal 3rd party package dependencies - in fact there is only one: colorama.

The scope of the project was intentionally minimal, but some fun ideas if I return to this project would be:

  • Implementing different guis - maybe through a web app or tkinter
  • Implement a genuine AI
  • Implement a non-local multiplayer mode

Project Structure

Not counting recursively, there are currently 8 sub-modules/packages which are published in the jchess whl (plus one module used only for testing). The project structure can be thought of as follows:

+-----------------------------------------------------+
|          pieces ---- board       display ------ run |
|         /                  \    /                   |
| geometry                    game                    |
|         \                  /    \                   |
|          terminal -- action      (testutils)        |
+-----------------------------------------------------+

Metadata

Release files for jchess 0.99

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for jchess 0.99
File Size Uploaded Provenance Actions
jchess-0.99.tar.gz 31.2 kB Without provenance Details for jchess-0.99.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for jchess 0.99
File Interpreter ABI Platform Actions
jchess-0.99-py3-none-any.whl Python 3 none any Details for jchess-0.99-py3-none-any.whl

Total release size: 63.6 kB

Release files / jchess-0.99.tar.gz

Download URL jchess-0.99.tar.gz
Size 31.2 kB
Tags Source
SHA-256 checksum
How to use checksums
2c2cb9b0f828206a19fade159c3a9ff82da3a7a01e0037277a0284aaaaba417a
BLAKE2b-256 checksum
How to use checksums
0992de5f9156458903e64a8c77a6ba8706dad272ae1a480f76c0276538f7b75c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.0

Release files / jchess-0.99-py3-none-any.whl

Download URL jchess-0.99-py3-none-any.whl
Size 32.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fdfcb0d0da41631d66a1f46153a2d0b87b02db32490d39c606e04c9e8a1c3b18
BLAKE2b-256 checksum
How to use checksums
d5091df6a3ab4b05466f1082ac9cdbac0831851bd23af65bc60b0ce0654498c0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.0

Security for jchess 0.99

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.99 This release

2 release files No provenance

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