sportsdataio-api-client

A feign-based Java API client for the sportsdata.io API

Лицензия

Лицензия

Категории

Категории

Данные CLI Взаимодействие с пользователем
Группа

Группа

io.github.enemyghost
Идентификатор

Идентификатор

sportsdataio-api-client
Последняя версия

Последняя версия

0.3.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

sportsdataio-api-client
A feign-based Java API client for the sportsdata.io API
Ссылка на сайт

Ссылка на сайт

https://github.com/enemyghost/sportsdataio-api-client
Система контроля версий

Система контроля версий

http://github.com/enemyghost/sportsdataio-api-client/tree/master

Скачать sportsdataio-api-client

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/io.github.enemyghost/sportsdataio-api-client/ -->
<dependency>
    <groupId>io.github.enemyghost</groupId>
    <artifactId>sportsdataio-api-client</artifactId>
    <version>0.3.0</version>
</dependency>
// https://jarcasting.com/artifacts/io.github.enemyghost/sportsdataio-api-client/
implementation 'io.github.enemyghost:sportsdataio-api-client:0.3.0'
// https://jarcasting.com/artifacts/io.github.enemyghost/sportsdataio-api-client/
implementation ("io.github.enemyghost:sportsdataio-api-client:0.3.0")
'io.github.enemyghost:sportsdataio-api-client:jar:0.3.0'
<dependency org="io.github.enemyghost" name="sportsdataio-api-client" rev="0.3.0">
  <artifact name="sportsdataio-api-client" type="jar" />
</dependency>
@Grapes(
@Grab(group='io.github.enemyghost', module='sportsdataio-api-client', version='0.3.0')
)
libraryDependencies += "io.github.enemyghost" % "sportsdataio-api-client" % "0.3.0"
[io.github.enemyghost/sportsdataio-api-client "0.3.0"]

Зависимости

compile (9)

Идентификатор библиотеки Тип Версия
com.fasterxml.jackson.core : jackson-databind jar 2.10.1
com.fasterxml.jackson.datatype : jackson-datatype-jdk8 jar 2.10.1
com.fasterxml.jackson.datatype : jackson-datatype-jsr310 jar 2.10.1
io.github.openfeign : feign-core jar 10.7.0
io.github.openfeign : feign-jackson jar 10.7.0
io.github.openfeign : feign-jaxrs jar 10.7.0
io.github.openfeign : feign-slf4j jar 10.7.0
javax.ws.rs : jsr311-api jar 1.1.1
org.slf4j : slf4j-api jar 1.7.26

test (4)

Идентификатор библиотеки Тип Версия
com.google.guava : guava jar 28.1-jre
io.github.openfeign : feign-mock jar 10.7.0
org.junit.jupiter : junit-jupiter-api jar 5.3.2
org.junit.jupiter : junit-jupiter-engine jar 5.3.2

Модули Проекта

Данный проект не имеет модулей.

sportsdata.io API Client

This is a feign based Java client for the sportsdata.io API.

Maven

    <dependency>
        <groupId>io.github.enemyghost</groupId>
        <artifactId>sportsdataio-api-client</artifactId>
        <version>0.3.0</version>
    </dependency>

This dependency will transitively bring required Feign and Jackson dependencies.

Usage

Use FeignClientFactory to get a properly configured Feign client targeting NcaaBasketballV3ApiClient:

    final NcaaBasketballV3ApiClient client = FeignClientFactory.createClient("https://api.sportsdata.io",
            API_KEY,
            NcaaBasketballV3ApiClient.class);
    final List<Conference> conferences = client.leagueHierarchy();
    conferences
            .stream()
            .map(Conference::getName)
            .forEach(System.out::println);

You can also add your own configuration to the Feign client:

final NcaaBasketballV3ApiClient client = FeignClientFactory.createDefaultBuilder(API_KEY, NcaaBasketballV3ApiClient.class)
        .client(myConfiguredClient)
        .logLevel(Level.FULL)
        .target("https://api.sportsdata.io", NcaaBasketballV3ApiClient.class);

Of course, you can avoid using the factory altogether and configure your own Feign client however you like.

Coverage

Currently, only the following endpoints for NCAA Men's Basketball are supported.

  • FREE tier
    • Are Games In Progress
    • Current Season
    • League Hierarchy
    • Player Details by Active
    • Player Details by Player
    • Player Details by Team
    • Stadiums
    • Teams
  • PLAYER STATS tier
    • Player Game Stats by Date
    • Player Game Stats by Player
  • FANTASY tier
    • Projected Game Stats by Date
    • Projected Game Stats by Player

The project is under active development.

Implementation Details

Accessors for all properties marked as nullable in the API documentation will return an Optional. A value of Optional#empty() represents a null field in the API response.

Contributions

Contributions are welcome, and should follow the patterns established in the entities and client packages. PRs will run mvn package to verify changes. Test coverage is required.

Build

$ git clone git@github.com:enemyghost/sportsdataio-api-client.git
$ cd sportsdataio-api-client
$ mvn clean install

Версии библиотеки

Версия
0.3.0
0.2.0