Skip to main content

berserk

https://img.shields.io/pypi/v/berserk.svg https://img.shields.io/travis/rhgrant10/berserk.svg Documentation Status

Python client for the lichess API

Features

  • handles JSON and PGN formats at user’s discretion

  • all endpoints implemented

  • token auth support provided

  • easy integration with oauth2

Usage

You can use any requests.Session-like object as a session, including those from requests_oauth. A simple token session is included, as shown below:

import berserk


session = berserk.TokenSession('token')
lichess = berserk.Client(session)

lichess.account.get()
lichess.account.get_email()
lichess.account.get_preferences()
lichess.account.get_kid_mode()
lichess.account.set_kid_mode()
lichess.account.upgrade_to_bot()

lichess.users.get_realtime_statuses()
lichess.users.get_all_top_10()
lichess.users.get_leaderboard()
lichess.users.get_public_data()
lichess.users.get_activity_feed()
lichess.users.get_by_id()
lichess.users.get_by_team()
lichess.users.get_live_streamers()

lichess.games.export()
lichess.games.export_by_player()
lichess.games.export_multi()
lichess.games.get_among_players()
lichess.games.get_ongoing()
lichess.games.get_tv_channels()

lichess.bots.stream_incoming_events()
lichess.bots.stream_game_state()
lichess.bots.make_move()
lichess.bots.post_message()
lichess.bots.abort_game()
lichess.bots.resign_game()
lichess.bots.accept_challenge()
lichess.bots.decline_challenge()

lichess.tournaments.get()
lichess.tournaments.create()

Details for each function can be found in the full documentation.

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

History

0.2.1 (2018-12-08)

  • Bump requests dependency to >=2.20.0 (CVE-2018-18074)

0.2.0 (2018-12-08)

  • Add position and start_date params to Tournament.create

  • Add Position enum

0.1.2 (2018-07-14)

  • Fix an asine bug in the docs

0.1.1 (2018-07-14)

  • Added tests for session and formats modules

  • Fixed mispelled PgnHandler class (!)

  • Fixed issue with trailing whitespace when splitting multiple PGN texts

  • Fixed the usage overview in the README

  • Fixed the versions for travis-ci

  • Made it easier to test the JsonHandler class

  • Salted the bumpversion config to taste

0.1.0 (2018-07-10)

  • First release on PyPI.

Release files for berserk 0.2.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 berserk 0.2.1
File Size Uploaded
berserk-0.2.1.tar.gz 23.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for berserk 0.2.1
File Interpreter ABI Platform
berserk-0.2.1-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size:37.7 kB

Release files / berserk-0.2.1.tar.gz

Download URL berserk-0.2.1.tar.gz
Size 23.9 kB
Tags Source
SHA-256 checksum
How to use checksums
0330f0b4b77b82f4d984270204b6a86f8c7f2adcaf4297e994fb1ccb7967db54
BLAKE2b-256 checksum
How to use checksums
02a759a7d596adb1b90cfe0a62039e6ff7be5f62941a1105dcfc2ae329a2a280
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.10.0 pkginfo/1.4.2 requests/2.18.4 setuptools/28.8.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.3

Release files / berserk-0.2.1-py2.py3-none-any.whl

Download URL berserk-0.2.1-py2.py3-none-any.whl
Size 13.8 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
25123f03135ca703ef9ca21a6975f08b754e5f70a6aa92381ab3291e3be24984
BLAKE2b-256 checksum
How to use checksums
a00be1987f5b14c2d4b6b956c19a26e4cad85777a31b278ed588c357a89b0e8f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.10.0 pkginfo/1.4.2 requests/2.18.4 setuptools/28.8.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.3
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