cfbd_json_py

Welcome!

This is the official docs page for the cfbd_json_py python package.

To the left of this page are various endpoints for this python package.

  • cfbd_json_py.betting: Holds functions for betting lines and betting data from the CFBD API.
  • cfbd_json_py.coaches: Holds functions for you to get coaching data (past and present).
  • cfbd_json_py.conferences: Holds functions for you to get information for CFB conferences.
  • cfbd_json_py.draft: Holds functions for you to get NFL draft information/data for various players in the CFBD API
  • cfbd_json_py.drives: Holds functions for you to get data for offensive and/or defensive drives within the CFBD API.
  • cfbd_json_py.games: Holds functions for you to get various data points pertaining to actual CFB games within the CFBD API.
  • cfbd_json_py.metrics: Holds functions to allow you to calculate or retrieve various advanced metrics from the CFBD API.
  • cfbd_json_py.players: Holds functions for you to get various data endpoints related to player stats, player information, and player data.
  • cfbd_json_py.plays: Holds functions for play-by-play (PBP) data for CFB games, as well as a way to calculate stats from PBP data.
  • cfbd_json_py.rankings: Holds functions for various CFB team ranking polls, and their results.
  • cfbd_json_py.ratings: Holds functions to allow you to get various team ratings data (like SP+, SRS, and Elo team ratings) from the CFBD API.
  • cfbd_json_py.recruiting: Holds functions for you to access CFB recruiting data and information, as well as team and player ratings for recruiting.
  • cfbd_json_py.stats: Holds functions for you to get various team stats from the CFBD API.
  • cfbd_json_py.teams: Holds functions for you to get team information and data, as well as head-to-head records and matchup history.
  • cfbd_json_py.utls: Various utilities that can be used from this package. Outside of cfbd_json_py.utls.set_cfbd_api_token(), you don't need to call any of these functions directly.
  • cfbd_json_py.venues: Holds functions for you to get information on various venues/stadiums within the college football world.

Basic Setup

If you have a CFBD API key, you have three ways to set it for this python package to use:

  1. Declare the API key as a string variable in a python script (not recommended, extreme security risk).
  2. Declare the API key in your environment as CFBD_API_KEY.
    • cfbd_json_py will first look for your environment, if you don't declare the API key as a string variable, when calling any function in this python package that uses a CFBD API call.
    • If you're using GitHub Actions with this package, just set a repository secret with the name CFBD_API_KEY. Again, this package will automatically know where to look, if you've set your API key in the environment.
  3. Use cfbd_json_py.utls.set_cfbd_api_token() to store the API key in an encrypted file on your machine.
    • To set the API key for this package with this function, run this code in a python script, replacing "TigersAreAwesome" with your API key:
from cfbd_api_key.utls import set_cfbd_api_token

cfbd_api_key = "TigersAreAwesome" # replace this with your actual API key
set_cfbd_api_token(api_key=cfbd_api_key)

NOTE: In a future version, there will be an executable application separate from this package for Windows, Mac, and Linux users to effectively do the same thing as the above code block, but with a graphical user interface (GUI).

If you want to see how to use this python package after setting up your API key, click on one of the submodules on the left to view the various functions within each submodule. Each function has a tutorial script on the various ways you can call that function.

Other Notes

  • If you want to see all CFBD API endpoints that are currently supported, click here to access the current Swagger docs for the entire API.
  • If you want to see the source code for this package, click here to see the current stable build of this python package on GitHub.
  • If you want to see the active changelog for this python package, click here to view the changelog of this python package on GitHub.
  1# Creation Date: 08/30/2023 01:13 EDT
  2# Last Updated Date: 04/04/2024 05:10 PM EDT
  3# Author: Joseph Armstrong (armstrongjoseph08@gmail.com)
  4# File Name: __init__.py
  5# Purpose: Allows for the python package to function,
  6#          by allowing you to to access functions within
  7#          this package.
  8###############################################################################
  9"""
 10# Welcome!
 11This is the official docs page for the `cfbd_json_py` python package.
 12
 13To the left of this page are various endpoints for this python package.
 14- `cfbd_json_py.betting`:
 15    Holds functions for betting lines and betting data from the CFBD API.
 16- `cfbd_json_py.coaches`:
 17    Holds functions for you to get coaching data (past and present).
 18- `cfbd_json_py.conferences`:
 19    Holds functions for you to get information for CFB conferences.
 20- `cfbd_json_py.draft`:
 21    Holds functions for you to get NFL draft information/data for
 22    various players in the CFBD API
 23- `cfbd_json_py.drives`:
 24    Holds functions for you to get data for offensive and/or defensive drives
 25    within the CFBD API.
 26- `cfbd_json_py.games`:
 27    Holds functions for you to get various data points pertaining to
 28    actual CFB games within the CFBD API.
 29- `cfbd_json_py.metrics`:
 30    Holds functions to allow you to calculate
 31    or retrieve various advanced metrics
 32    from the CFBD API.
 33- `cfbd_json_py.players`:
 34    Holds functions for you to get various
 35    data endpoints related to player stats,
 36    player information, and player data.
 37- `cfbd_json_py.plays`:
 38    Holds functions for play-by-play (PBP) data for CFB games,
 39    as well as a way to calculate stats from PBP data.
 40- `cfbd_json_py.rankings`:
 41    Holds functions for various CFB team ranking polls,
 42    and their results.
 43- `cfbd_json_py.ratings`:
 44    Holds functions to allow you to get various team ratings data
 45    (like SP+, SRS, and Elo team ratings) from the CFBD API.
 46- `cfbd_json_py.recruiting`:
 47    Holds functions for you to access CFB recruiting data and information,
 48    as well as team and player ratings for recruiting.
 49- `cfbd_json_py.stats`:
 50    Holds functions for you to get various team stats from the CFBD API.
 51- `cfbd_json_py.teams`:
 52    Holds functions for you to get team information and data,
 53    as well as head-to-head records and matchup history.
 54- `cfbd_json_py.utls`:
 55    Various utilities that can be used from this package.
 56    Outside of `cfbd_json_py.utls.set_cfbd_api_token()`,
 57    you don't need to call any of these functions directly.
 58- `cfbd_json_py.venues`:
 59    Holds functions for you to get information on
 60    various venues/stadiums within the college football world.
 61
 62# Basic Setup
 63
 64If you have a CFBD API key,
 65you have three ways to set it for this python package to use:
 661. Declare the API key as a string variable
 67    in a python script (not recommended, extreme security risk).
 682. Declare the API key in your environment as `CFBD_API_KEY`.
 69    - `cfbd_json_py` will first look for your environment,
 70    if you don't declare the API key as a string variable,
 71    when calling any function in this python package that uses a CFBD API call.
 72    - If you're using GitHub Actions with this package,
 73    just set a repository secret with the name `CFBD_API_KEY`.
 74    Again, this package will automatically know where to look,
 75    if you've set your API key in the environment.
 763. Use `cfbd_json_py.utls.set_cfbd_api_token()`
 77    to store the API key in an encrypted file on your machine.
 78    - To set the API key for this package with this function,
 79    run this code in a python script,
 80    replacing `"TigersAreAwesome"` with your API key:
 81
 82```
 83from cfbd_api_key.utls import set_cfbd_api_token
 84
 85cfbd_api_key = "TigersAreAwesome" # replace this with your actual API key
 86set_cfbd_api_token(api_key=cfbd_api_key)
 87```
 88
 89> **NOTE:** *In a future version,
 90    there will be an executable application separate from this package
 91    for Windows, Mac, and Linux users to effectively do the same thing
 92    as the above code block, but with a graphical user interface (GUI).*
 93
 94If you want to see how to use this
 95python package after setting up your API key,
 96click on one of the submodules on the left
 97to view the various functions within each submodule.
 98Each function has a tutorial script on
 99the various ways you can call that function.
100
101# Other Notes
102- If you want to see all CFBD API endpoints that are currently supported,
103[click here](
104    https://api.collegefootballdata.com/api/docs/?url=/api-docs.json#/)
105    to access the current Swagger docs for the entire API.
106- If you want to see the source code for this package,
107    [click here](https://github.com/armstjc/cfbd-json-py)
108    to see the current stable build of this python package on GitHub.
109- If you want to see the active changelog for this python package,
110    [click here]() to view the changelog of this python package on GitHub.
111
112"""
113
114# Generated Functions:
115from cfbd_json_py._early_access import *  # noqa: F403
116
117
118# Fully Implemented Functions:
119from cfbd_json_py.betting import *  # noqa: F403
120from cfbd_json_py.coaches import *  # noqa: F403
121from cfbd_json_py.conferences import *  # noqa: F403
122from cfbd_json_py.draft import *  # noqa: F403
123from cfbd_json_py.drives import *  # noqa: F403
124from cfbd_json_py.games import *  # noqa: F403
125from cfbd_json_py.metrics import *  # noqa: F403
126from cfbd_json_py.players import *  # noqa: F403
127from cfbd_json_py.plays import *  # noqa: F403
128from cfbd_json_py.rankings import *  # noqa: F403
129from cfbd_json_py.ratings import *  # noqa: F403
130from cfbd_json_py.recruiting import *  # noqa: F403
131from cfbd_json_py.stats import *  # noqa: F403
132from cfbd_json_py.teams import *  # noqa: F403
133from cfbd_json_py.venues import *  # noqa: F403
134
135# Utils
136
137from cfbd_json_py.utls import *  # noqa: F403