lahman

package
v0.0.0-...-4f5e7a9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 24, 2015 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load

func Load(years ...int)

Types

type BatStats

type BatStats [18]float64

BatStats is an array that holds the 18 tracked batting statistics for a Player. 17 are imported from the lahmanDB, and PA is calculated from that data.

func (BatStats) AB

func (b BatStats) AB() float64

func (BatStats) BB

func (b BatStats) BB() float64

func (BatStats) CS

func (b BatStats) CS() float64

func (BatStats) G

func (b BatStats) G() float64

func (BatStats) GIDP

func (b BatStats) GIDP() float64

func (BatStats) H

func (b BatStats) H() float64

func (BatStats) H2

func (b BatStats) H2() float64

func (BatStats) H3

func (b BatStats) H3() float64

func (BatStats) HBP

func (b BatStats) HBP() float64

func (BatStats) HR

func (b BatStats) HR() float64

func (BatStats) IBB

func (b BatStats) IBB() float64

func (BatStats) PA

func (b BatStats) PA() float64

PA, etc, return the Player's named batting stat.

func (BatStats) Precise

func (b BatStats) Precise() string

func (BatStats) R

func (b BatStats) R() float64

func (BatStats) RBI

func (b BatStats) RBI() float64

func (BatStats) SB

func (b BatStats) SB() float64

func (BatStats) SF

func (b BatStats) SF() float64

func (BatStats) SH

func (b BatStats) SH() float64

func (BatStats) SO

func (b BatStats) SO() float64

func (BatStats) String

func (b BatStats) String() string

String returns a list of the 18 battings stats (including PA).

type PitchStats

type PitchStats [25]float64

PitchStats is an array that holds the 25 tracked pitching statistics for a Player.

func (PitchStats) BAopp

func (p PitchStats) BAopp() float64

func (PitchStats) BB

func (p PitchStats) BB() float64

func (PitchStats) BFP

func (p PitchStats) BFP() float64

func (PitchStats) BK

func (p PitchStats) BK() float64

func (PitchStats) CG

func (p PitchStats) CG() float64

func (PitchStats) ER

func (p PitchStats) ER() float64

func (PitchStats) ERA

func (p PitchStats) ERA() float64

func (PitchStats) G

func (p PitchStats) G() float64

func (PitchStats) GF

func (p PitchStats) GF() float64

func (PitchStats) GIDP

func (p PitchStats) GIDP() float64

func (PitchStats) GS

func (p PitchStats) GS() float64

func (PitchStats) H

func (p PitchStats) H() float64

func (PitchStats) HBP

func (p PitchStats) HBP() float64

func (PitchStats) HR

func (p PitchStats) HR() float64

func (PitchStats) IBB

func (p PitchStats) IBB() float64

func (PitchStats) IPouts

func (p PitchStats) IPouts() float64

func (PitchStats) L

func (p PitchStats) L() float64

func (PitchStats) R

func (p PitchStats) R() float64

func (PitchStats) SF

func (p PitchStats) SF() float64

func (PitchStats) SH

func (p PitchStats) SH() float64

func (PitchStats) SHO

func (p PitchStats) SHO() float64

func (PitchStats) SO

func (p PitchStats) SO() float64

func (PitchStats) SV

func (p PitchStats) SV() float64

func (PitchStats) String

func (p PitchStats) String() string

String returns a list of the 25 pitching stats, formatted correctly.

func (PitchStats) W

func (p PitchStats) W() float64

W, etc, return the Player's named pitching stat.

func (PitchStats) WP

func (p PitchStats) WP() float64

type Player

type Player struct {
	Bat BatStats
	Pit PitchStats
	// contains filtered or unexported fields
}

A Player is a struct that contains all batting and pitching stats for a player.

func GetPlayer

func GetPlayer(id string, year int, n int) []*Player

GetPlayer returns the past 3 years of data for that Player TODO: test

func GetPostYear

func GetPostYear(year int) []*Player

GetPostYear returns a list of all Players, with batting and pitching lines, for postseason that year.

func GetYear

func GetYear(year int) []*Player

GetYear returns a list of all Players, with batting and pitching lines, for the regular season that year.

func (Player) Bio

func (p Player) Bio() string

Bio returns a string with a player's biographical details.

func (Player) Birth

func (p Player) Birth() int

Birth returns a player's birth year.

func (Player) ID

func (p Player) ID() string

ID returns a player's lahmanDB ID

func (Player) IsBatter

func (p Player) IsBatter() bool

func (Player) IsPitcher

func (p Player) IsPitcher() bool

func (Player) IsPosPitcher

func (p Player) IsPosPitcher() bool

IsPosPitcher returns true if the player was normally a position player, but pitched at least once.

func (Player) League

func (p Player) League() string

League returns the league a Player played for.

func (Player) Name

func (p Player) Name() string

Name returns a player's name.

func (Player) Stint

func (p Player) Stint() string

Stint returns:

for regular season play, the number of their season's appearance with a given team
(In other words, if a players is traded their stats for the second team will be stint "2")
for postseason play, the *round* of play

func (Player) String

func (p Player) String() string

String returns a string representing a Player's complete statline.

func (Player) Team

func (p Player) Team() string

Team returns the team code a Player played for.

func (Player) Year

func (p Player) Year() int

Year returns the year of a Player's statline.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL