Skip to content

Player Data API

PlayerStatsEndpoint

Bases: StrEnum

Direct NBA Stats endpoints used by the player reference pipeline.

PlayerStatsError

Bases: RuntimeError

Raised when direct NBA player reference data is unavailable or invalid.

PlayerStatsResponse

Bases: BaseModel

One exact NBA Stats player endpoint response and request provenance.

PlayerStatsCacheMetadata

Bases: BaseModel

Sidecar evidence for a byte-preserved player endpoint response.

PlayerStatsCache

Byte-preserving cache for season-addressable player endpoint responses.

PlayerStatsClient

Direct client for bulk NBA player index and season bio data.

PlayerIdentity

Bases: BaseModel

One historical NBA player identity and latest listed attributes.

PlayerCatalog

Bases: BaseModel

Versioned historical NBA player identity catalog.

PlayerSeasonBio

Bases: BaseModel

Leakage-safe physical and background fields for one player-season.

PlayerSeasonBioDataset

Bases: BaseModel

Versioned player-season bio rows for one season and competition type.

PlayerSeasonBioManifest

Bases: BaseModel

Integrity and source evidence for one player-season bio partition.

player_catalog_from_response(response)

Normalize the historical PlayerIndex response without lossy ID coercion.

player_season_bios_from_response(response, catalog)

Normalize season bio fields while excluding same-season performance.

player_catalog_frame(catalog)

Return a typed historical player catalog ordered by numeric ID.

player_catalog_from_frame(frame)

Validate a historical player catalog frame.

write_player_catalog(catalog, path=Path('data/catalog/players.parquet'))

Atomically write the canonical historical player catalog.

read_player_catalog(path=Path('data/catalog/players.parquet'))

Read and validate the historical player catalog.

merge_player_catalogs(existing, incoming)

Preserve the union of players while preferring the latest source row.

player_season_bio_frame(dataset)

Return a typed player-season bio frame ordered by player ID.

player_season_bios_from_frame(frame)

Validate one player-season bio frame.

player_season_partition_dir(season, season_type, curated_dir=Path('data/curated'))

Return the plain-directory player-season partition path.

write_player_season_bios(dataset, curated_dir=Path('data/curated'))

Atomically publish one self-contained player-season bio partition.

read_player_season_bios(season, season_type='regular', curated_dir=Path('data/curated'))

Read and validate one player-season bio partition.

read_player_season_manifest(season, season_type='regular', curated_dir=Path('data/curated'))

Read one player-season bio integrity manifest.

validate_player_season_partition(season, season_type='regular', curated_dir=Path('data/curated'))

Require exact file integrity, schema, IDs, and row counts.

PlayerBioCollectionSummary

Bases: BaseModel

Terminal summary for one bulk player reference collection.

collect_player_bios(season, *, season_type='regular', raw_dir=Path('data/raw'), player_catalog_path=Path('data/catalog/players.parquet'), curated_dir=Path('data/curated'), refresh=False, client=None)

Fetch two bulk NBA endpoints and publish player reference datasets.