Skip to main content

Python client for the lichess API

Project description

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

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.challenges.create()
lichess.challenges.accept()
lichess.challenges.decline()

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.3.1 (2018-12-23)

  • Convert datetime string in tournament creation response into datetime object

0.3.0 (2018-12-23)

  • Convert all timestamps to datetime in all responses

  • Provide support for challenging other players to a game

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.

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

berserk-0.3.1.tar.gz (30.5 kB view details)

Uploaded Source

Built Distribution

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

berserk-0.3.1-py2.py3-none-any.whl (15.6 kB view details)

Uploaded Python 2Python 3

File details

Details for the file berserk-0.3.1.tar.gz.

File metadata

  • Download URL: berserk-0.3.1.tar.gz
  • Upload date:
  • Size: 30.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.10.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.3

File hashes

Hashes for berserk-0.3.1.tar.gz
Algorithm Hash digest
SHA256 0b1e8cc729c723a413763a2b6421ef2313ddf2b8a36f2478f7be6bdefc192d23
MD5 877b31294b1f8d406a472e650a58c53a
BLAKE2b-256 0fdfef9f0ae39a7c1d4551ba5a2ce7c6e01232c0d5d8bcaba51917f8134fd3f9

See more details on using hashes here.

File details

Details for the file berserk-0.3.1-py2.py3-none-any.whl.

File metadata

  • Download URL: berserk-0.3.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 15.6 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.10.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.3

File hashes

Hashes for berserk-0.3.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 8c84340a17e2e72d1655594afbad2d809408dda2e3a7d796ecacc9906b63047f
MD5 218428afc67f70467208d8fbba579ee6
BLAKE2b-256 bb09d25b49f70145e07a5ca7aa1a5ff9bf5499ba0754341a592a2e8d165ed621

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