Giter VIP home page Giter VIP logo

lichess4j's Introduction

Build Status Codecov Coverage Status Language grade: Java

Lichess4J

A java wrapper for the Lichess API

This library aims to create a general purpase java wrapper for the Lichess API.

Installing / Getting started

⚠️ This project is still in the early stages of developement.: All aspects of the api are subject to change. Please use this library for experimental purposes only.

Maven

This package is not part of the maven central repository (yet). It can however be imported through github packages, which requires authorization.

  1. Generate a new github personal access token as described here
  2. Update your home~.m2/settings.xml file to include your github username and the generated access token. It may look similar to this:
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd">
    <localRepository/>
    <interactiveMode/>
    <offline/>
    <pluginGroups/>
    <servers>
        <server>
            <id>github</id>
            <username>YOUR_USERNAME</username>
            <password>YOUR_GITHUB_ACTION_TOKEN</password>
        </server>
    </servers>
    <mirrors/>
    <proxies/>
    <profiles/>
    <activeProfiles/>
</settings>
  1. Include the following in your pom.xml file (please replace VERSION_NUMBER with the latest release version):
<project>
    ...    
    <repositories>
		<repository>
			<id>github</id>
			<name>GitHub Packages CapOfCave/Lichess4J</name>
			<url>https://maven.pkg.github.com/CapOfCave/Lichess4J/</url>
		</repository>
	</repositories>
    ...
    <dependencies>
		<dependency>
			<groupId>me.kecker</groupId>
			<artifactId>lichess4j</artifactId>
			<version>VERSION_NUMBER</version>
		</dependency>
	</dependencies>
</project>
  1. Run
mvn install

to ensure everything was set up correctly.

Features

For a full list of currently implemented features, please have a look at the endpoint coverage documentation .

Contributing

Do you want to contribute to this library? We'd love your help. Please refer to our contribution guideline

Building locally

If you want to run this project locally, please go through the following steps:

git clone https://github.com/CapOfCave/Lichess4J.git
cd Lichess4J/
mvn clean install

This will clone this repository, perform tests and build it.

Licensing

The code in this project is licensed under MIT license. See the LICENSE file for a detailed description of rights and limitations when using this project.

lichess4j's People

Contributors

capofcave avatar dependabot-preview[bot] avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

lgtm-migrator

lichess4j's Issues

Make the API usable without a lichess api token

Many of the features of the lichess api are accessible without authorization
(see https://lichess.org/api#tag/OAuth for a complete list of endpoints that require authorization)

As such, the bearer Token should be nullable. In order to achieve that, any @nonnull annotations should be removed. Additionally, the HttpRequestFactory should not append the Authorization header if the bearerToken is null.

Create a default value for the Title enum

When mapping an Account without title, null is returned. This should be replaced by the null object Title.NONE.

A generalized solution should be preferred since there will probably be more enums that should have a default value.

Add end-to-end tests

For each method from the public API, there should be one test case:

  • Mock the HTTP request, returning data from a json file that was copyed from the official api docs. (For file reading, the existing FileReaderUtil can be used.)
  • call the method that should be tested
  • verify that the result equals the result returned from the relevant TestProvider

Specify Codecov requirements

With a test coverage pf almost 100%, codecov will fail as soon as a single instruction is missed in the tests.
A test coverage of 95-99% should be enough and a more reasonable balance of code quality and required resources.

This number should be enforced and displayed through a codecov.yml file

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.