Skip to content

Common

Classes

kloppy.domain.models.common.Metadata dataclass

Metadata

Attributes:

Name Type Description
teams List[kloppy.domain.models.common.Team]

[home_team, away_team]. See Team

periods List[kloppy.domain.models.common.Period]

See Period

pitch_dimensions PitchDimensions

See PitchDimensions

score Score

See Score

frame_rate float
orientation Orientation

See Orientation

flags DatasetFlag
provider Provider

See Provider

kloppy.domain.models.common.Player dataclass

Attributes:

Name Type Description
player_id str

identifier given by the provider

team Team

See Team

jersey_no int

Jersey number

name str

Full name of the player

first_name str

First name

last_name str

Last name

starting bool

True when player is part of the starting 11

position Position

See `Position

attributes Optional[Dict]

attributes given by the provider

kloppy.domain.models.common.Position dataclass

Position(position_id: str, name: str, coordinates: kloppy.domain.models.pitch.Point)

kloppy.domain.models.common.Team dataclass

Attributes:

Name Type Description
team_id str

id of the team, given by the provider

name str

readable name of the team

ground Ground

See Ground

players List[kloppy.domain.models.common.Player]

See Player

kloppy.domain.models.common.Score dataclass

Score

Attributes:

Name Type Description
home int
away int

kloppy.domain.models.common.Period dataclass

Period

Attributes:

Name Type Description
id int

1 for first half, 2 for second half

start_timestamp float

timestamp given by provider (can be unix timestamp or relative)

end_timestamp float

timestamp given by provider (can be unix timestamp or relative)

attacking_direction Optional[kloppy.domain.models.common.AttackingDirection]

See AttackingDirection

Enums

kloppy.domain.models.common.AttackingDirection

AttackingDirection

Attributes:

Name Type Description
HOME_AWAY AttackingDirection

Home team is playing from left to right

AWAY_HOME AttackingDirection

Home team is playing from right to left

NOT_SET AttackingDirection

not set yet

kloppy.domain.models.common.BallState

BallState

Attributes:

Name Type Description
ALIVE BallState

Ball is in play

DEAD BallState

Ball is not in play

kloppy.domain.models.common.DatasetType

DatasetType

Attributes:

Name Type Description
TRACKING DatasetType
EVENT DatasetType
CODE DatasetType

kloppy.domain.models.common.Ground

Attributes:

Name Type Description
HOME

home playing team

AWAY

away playing team

REFEREE

Referee (could be used in tracking data)

kloppy.domain.models.common.Orientation

An enumeration.

kloppy.domain.models.common.Provider

Attributes:

Name Type Description
METRICA
TRACAB
OPTA
SKILLCORNER
STATSBOMB
SPORTEC
WYSCOUT