Skip to main content

play-lichess

build version license Discord

Python module for creating match links on Lichess that two players can join

📥 Installation

pip install play-lichess

🧑‍💻 Usage

Start a real-time match

import play_lichess

match = play_lichess.real_time()

print(match.link)  # eg. https://lichess.org/8KbWoJyU
print(match.title)  # Rapid (5+8) casual Chess • Open challenge • lichess.org
print(match.variant)  # Standard
print(match.color)  # Random
print(match.time_mode)  # Real-time

Start a correspondence match

import play_lichess

match = play_lichess.correspondence()

print(match.link)  # eg. https://lichess.org/8KbWoJyU
print(match.title)  # Correspondence casual Chess • Open challenge • lichess.org
print(match.variant)  # Standard
print(match.color)  # Random
print(match.time_mode)  # Correspondence

Start an unlimited time match

import play_lichess

match = play_lichess.unlimited()

print(match.link)  # eg. https://lichess.org/8KbWoJyU
print(match.title)  # Correspondence casual Chess • Open challenge • lichess.org
print(match.variant)  # Standard
print(match.color)  # Random
print(match.time_mode)  # Unlimited

Specify game options

import play_lichess
from play_lichess.constants import Variant, Color

match = play_lichess.real_time(
    minutes=6, 
    increment=0, 
    variant=Variant.ANTICHESS, 
    color=Color.WHITE
)

print(match.link)  # eg. https://lichess.org/8KbWoJyU
print(match.title)  # Blitz (6+0) casual Chess • Open challenge • lichess.org
print(match.variant)  # Antichess
print(match.color)  # White
print(match.time_mode)  # Real-time

Alternate syntax

import play_lichess
from play_lichess.constants import TimeMode, Variant, Color

match1 = play_lichess.create(time_mode=TimeMode.REALTIME, minutes=6, increment=0)

match2 = play_lichess.create(time_mode=TimeMode.CORRESPONDENCE, days=3)

match3 = play_lichess.create(TimeMode.UNLIMITED)

🔧 Options

Real-time

Argument Type Default Description
minutes int 5 The number of minutes for the match
increment int 8 Amount of seconds to increment the clock each turn
variant Variant STANDARD The variant of the match (STANDARD, CHESS960, etc.)
color Color RANDOM The color assigned to the first player that joins

Correspondence

Argument Type Default Description
days int 2 The number of days for the match
variant Variant STANDARD The variant of the match (STANDARD, CHESS960, etc.)
color Color RANDOM The color assigned to the first player that joins

Unlimited

Argument Type Default Description
variant Variant STANDARD The variant of the match (STANDARD, CHESS960, etc.)
color Color RANDOM The color assigned to the first player that joins

🧰 Development

To run tests (pytest)

python setup.py test

To lint (flake8):

pip install flake8==3.8.4 pytest

python setup.py lint

Metadata

Release files for play-lichess 0.1.1

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

Source distribution (sdist)

Source distribution for play-lichess 0.1.1
File Size Uploaded
play-lichess-0.1.1.tar.gz 6.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for play-lichess 0.1.1
File Interpreter ABI Platform
play_lichess-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 13.8 kB

Release files / play-lichess-0.1.1.tar.gz

Download URL play-lichess-0.1.1.tar.gz
Size 6.6 kB
Tags Source
SHA-256 checksum
How to use checksums
71e137b88e0d3c8cd459deaa621dacbedc1d44c1ea421f2ab09019db345208dc
BLAKE2b-256 checksum
How to use checksums
e6ba767aeec6920028805a94c79460a7a2eec1c69e15be60c934a5e110cf2f5f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.9

Release files / play_lichess-0.1.1-py3-none-any.whl

Download URL play_lichess-0.1.1-py3-none-any.whl
Size 7.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c1a39c8656bd902433312e73baf2275b8b90d639aa1b43805ee42395c5e03de3
BLAKE2b-256 checksum
How to use checksums
5205d420f26eac507c58dfbb006bf2a4cb761724163960a92dcf1dec9671dd48
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.9

Release history Release notifications | RSS feed

1.1.1

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.1.3

2 release files

0.1.2

2 release files

This release

0.1.1 This release

2 release files

0.1.0

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release 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