nbawrapper

Java NBA stats wrapper

License

License

Categories

Categories

Ant Build Tools
GroupId

GroupId

com.antoineguay
ArtifactId

ArtifactId

nbawrapper
Last Version

Last Version

0.0.6
Release Date

Release Date

Type

Type

jar
Description

Description

nbawrapper
Java NBA stats wrapper
Project URL

Project URL

https://github.com/antoineguay1/nbawrapper-stats
Source Code Management

Source Code Management

https://github.com/antoineguay1/nbawrapper-stats

Download nbawrapper

How to add to project

<!-- https://jarcasting.com/artifacts/com.antoineguay/nbawrapper/ -->
<dependency>
    <groupId>com.antoineguay</groupId>
    <artifactId>nbawrapper</artifactId>
    <version>0.0.6</version>
</dependency>
// https://jarcasting.com/artifacts/com.antoineguay/nbawrapper/
implementation 'com.antoineguay:nbawrapper:0.0.6'
// https://jarcasting.com/artifacts/com.antoineguay/nbawrapper/
implementation ("com.antoineguay:nbawrapper:0.0.6")
'com.antoineguay:nbawrapper:jar:0.0.6'
<dependency org="com.antoineguay" name="nbawrapper" rev="0.0.6">
  <artifact name="nbawrapper" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.antoineguay', module='nbawrapper', version='0.0.6')
)
libraryDependencies += "com.antoineguay" % "nbawrapper" % "0.0.6"
[com.antoineguay/nbawrapper "0.0.6"]

Dependencies

compile (6)

Group / Artifact Type Version
org.springframework : spring-core jar 4.3.10.RELEASE
org.springframework : spring-context jar 4.3.10.RELEASE
com.fasterxml.jackson.core : jackson-databind jar 2.9.0
org.apache.httpcomponents : httpclient jar 4.1.1
info.debatty : java-string-similarity jar 1.0.0
com.thoughtworks.xstream : xstream jar 1.4.7

test (1)

Group / Artifact Type Version
junit : junit jar 3.8.1

Project Modules

There are no modules declared in this project.

nbawrapper-stats

Maven Central

Java wrapper for NBA player/team/league stats and even more!

Installing

Using Maven

<dependency>
    <groupId>com.antoineguay</groupId>
    <artifactId>nbawrapper</artifactId>
    <version>0.0.6</version>
</dependency>

Using Gradle

repositories {
    mavenCentral()

    // Other repositories your app might use
}

dependencies {
    compile 'com.antoineguay:nbawrapper:0.0.6'

    // Other dependencies your app might use
}

Getting a player's profile

The Player object contains contains all the player's general information about his draft, height, weight, stats, etc. It also contains the player's headshot image.

Using keywords

To get a player's complete profile using keywords to search him, you can use the static method getPlayerByNameKeywords of the Player class.

Player player = Player.getPlayerByNameKeywords("westbrook");
System.out.println(player.getFirstName()); // Russell
System.out.println(player.getLastName()); // Westbrook

Using the player ID

To get a player's complete profile using his ID, you can use the static method getPlayerById of the Player class.

Player player = Player.getPlayerById("203471");
System.out.println(player.getFirstName()); // Dennis
System.out.println(player.getLastName()); // Schroder

Get player's short profile

You can also get a player's minimal profile, useful when displaying a roster for instance, using the static method getPlayerMinById of the Player class.

PlayerMin playerMin = Player.getPlayerMinById("203471");
System.out.println(playerMin.getFirstName()); // Dennis
System.out.println(playerMin.getLastName()); // Schroder

Getting a team's profile

The Team object contains a team's roster, stats leaders, games this season as well as the url to its logo image. It also contains general information.

Using keywords

To get a team's complete profile using keywords to search it, you can use the static method getTeamByNameKeywords of the Team class.

Team toronto = Team.getTeamByNameKeywords("Toronto");
System.out.println(toronto.getCity()); // Toronto
System.out.println(toronto.getFullName()); // Toronto Raptors

Team hawks = Team.getTeamByNameKeywords("Hawks");
System.out.println(hawks.getCity()); // Atlanta
System.out.println(hawks.getFullName()); // Atlanta Hawks

Using the team ID

To get a team's complete profile using its ID, you can use the static method getTeamById of the Team class.

Team team = Team.getTeamById("1610612737");
System.out.println(team.getCity()); // Atlanta
System.out.println(team.getFullName()); // Atlanta Hawks

Get team's short profile

You can also get a team's minimal profile, useful when displaying a list of teams for instance, using the static method getShortProfileByTeamId of the Team class.

TeamMin teamMin = Team.getShortProfileByTeamId("1610612737");
System.out.println(teamMin.getCity()); // Atlanta
System.out.println(teamMin.getFullName()); // Atlanta Hawks

Getting a scoreboard

Using a date

You can get the scoreboard on a certain date using the static method getScoreboard of League. For instance, to get the scoreboard on December 25th 2016, you can use this snippet of code

Scoreboard scoreboard = League.getScoreboard("25", "12", "2016");
// From this scoreboard, you can access different information
List<GameDetails> gameList = scoreboard.getGames();

Getting a boxscore

Using a date and a game ID

You can get the boxscore of a certain game using the static method getBoxscore of League. For instance, to get the boxscore of the game between the Cavaliers and the Warriors on December 25th 2016, you can use this snippet of code

Boxscore boxscore = League.getBoxscore("25", "12", "2016", "0021600457");
System.out.println(boxscore.getBasicGameData().getHomeTeam().getScore()); // 109
System.out.println(boxscore.getBasicGameData().getVisitingTeam().getScore()); // 108

Versions

Version
0.0.6
0.0.5
0.0.4
0.0.3
0.0.2
0.0.1