cfbd Python Client

repository·main·Indexed 42 days ago

https://github.com/cfbd/cfbd-python

A Python client for the College Football Data API (version 5.27.1), providing access to game, team, player, recruiting, ranking, and advanced metrics data. The SDK includes specialized API classes such as GamesApi, TeamsApi, and AdjustedMetricsApi, along with strongly-typed data models for responses.

Tokens
155.4K
Snippets
377
Records
534
Agent score
53%

What's inside cfbd

  1. Overview of cfbd.StatsApi

    main
    The StatsApi class provides methods to retrieve various college football statistics, including advanced game stats, advanced season stats, statistical categories, havoc stats, and player success rates. All requests are relative to https://api.collegefootballdata.com.
  2. Access documentation for data models

    main

    The cfbd library provides extensive documentation for the various data models returned by the API. You can find detailed schemas and field descriptions for models including, but not limited to:

    • Teams & Coaches: Team, Coach, Conference, Recruit.
    • Games & Stats: Game, Play, PlayerStat, TeamStat, AdvancedBoxScore.
    • Advanced Metrics: TeamPPA, TeamFPI, TeamElo, TeamSRS, AdjustedTeamMetrics.
    • Playoff & Rankings: CfpPlayoff, Poll, PlayoffRound.
    • Live Data: LiveGame, LiveGamePlay.

    Each model has a dedicated documentation page in the docs/ directory of the repository (e.g., docs/Team.md).

  3. Understand the TeamExplosiveness model

    main

    The TeamExplosiveness model represents explosiveness statistics for a specific team. It contains the team identifier and a breakdown of statistics by quarter.

    PropertyTypeDescription
    teamstrThe team identifier.
    overallStatsByQuarterA StatsByQuarter object containing the overall explosiveness stats.
  4. Understand the PassingProduction model

    main
    The PassingProduction model represents defense reports of opponent production allowed. It tracks passing metrics such as attempts, completions, incompletions, interceptions, and yardage, without inverting PPA (Predicted Points Added) signs. It also includes advanced metrics like success rate, PPA, and explosiveness, and contains a collection of PassingLocations.
  5. Understand the TeamScoringOpportunities model

    main

    The TeamScoringOpportunities model represents data regarding a team's scoring efficiency. It contains the following properties:

    PropertyTypeDescription
    teamstrThe identifier for the team
    opportunitiesintTotal number of scoring opportunities
    pointsintTotal points scored
    points_per_opportunityfloatThe calculated points per opportunity
  6. Understand the CoachCfpContext model

    main

    The CoachCfpContext model represents the context of a coach within the College Football Playoff (CFP) framework. It contains information regarding whether a coach appeared in the context, a seed value, and the specific season outcome.

    # Properties summary:
    # appeared: bool
    # seed: int
    # outcome: CfpCoachSeasonOutcome
  7. Understand the TeamPassingGame model

    main

    The TeamPassingGame model represents passing statistics for a specific team in a specific game. It includes identifiers for the game, season, and week, as well as details about the team, conference, opponent, and the season type. It contains two nested PassingProduction objects: one for the offense and one for the defense.

    | Name | Type | Description |
    |------------ | ------------- | ------------- |
    | **game_id** | **int** | |
    | **season** | **int** | |
    | **week** | **int** | |
    | **season_type** | [**SeasonType**](SeasonType.md) | |
    | **team** | **str** | |
    | **conference** | **str** | |
    | **opponent** | **str** | |
    | **offense** | [**PassingProduction**](PassingProduction.md) | |
    | **defense** | [**PassingProduction**](PassingProduction.md) | |
  8. Authenticate with the API using apiKey

    main
    The API uses Bearer authentication for authorization. To use the client, you must configure the apiKey parameter in accordance with the API server security policy. This key is passed as a Bearer token in the authorization header of your requests.
  9. Understand RushParseStatus enum values

    main

    The RushParseStatus enum represents the parsing status of a rush attempt. It can have one of three states:

    • COMPLETE: The parsing was successful and complete.
    • PARTIAL: The parsing was only partially successful.
    • INVALID: The parsing resulted in an invalid state.
  10. Understand the UserUsageRecentRequest model

    main

    The UserUsageRecentRequest model represents a recent request made by a user. It contains information about the API endpoint accessed and when the request occurred.

    Properties

    NameTypeDescription
    apiUserUsageApiThe associated User Usage API instance.
    endpointstrThe API endpoint that was requested.
    requested_atstrThe timestamp of when the request was made.