Skip to content

Commit

Permalink
Merge pull request #42 from armstjc/0.1.2-The-Spell-Check-update
Browse files Browse the repository at this point in the history
0.1.2: The "Spell Check" update
  • Loading branch information
armstjc authored Apr 12, 2024
2 parents 079673a + 73a5eba commit 44b6c5a
Show file tree
Hide file tree
Showing 39 changed files with 13,418 additions and 13,417 deletions.
34 changes: 19 additions & 15 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG: cfbd_json_py

## 0.1.2: The "Spell Check" update
- Fixed spelling errors previously present in earlier versions of this python package.
- Updated the package version to `0.1.2`.

## 0.1.1: The "housekeeping" update
- Cleaned up the formatting of all functions and python code.
- Updated the package version to `0.1.1`.
Expand All @@ -13,7 +17,7 @@

- Implemented `cfbd_json_py.ratings.get_cfbd_fpi_ratings()`, a function that allows a user to get Football Power Index (FPI) ratings data directly from the CFBD API.
- Implemented `cfbd_json_py.ratings.get_cfbd_elo_ratings()`, a function that allows a user to get Elo ratings data directly from the CFBD API.
- Implemented `cfbd_json_py.ratings.get_cfbd_sp_plus_conference_ratings()`, a function that allows a user to get Success rate and equivalent Points per play (S&P+) ratings data, grouped by confrence, directly from the CFBD API.
- Implemented `cfbd_json_py.ratings.get_cfbd_sp_plus_conference_ratings()`, a function that allows a user to get Success rate and equivalent Points per play (S&P+) ratings data, grouped by conference, directly from the CFBD API.
- Implemented `cfbd_json_py.ratings.get_cfbd_sp_plus_ratings()`, a function that allows a user to get Success rate and equivalent Points per play (S&P+) ratings data, directly from the CFBD API.
- Implemented `cfbd_json_py.ratings.get_cfbd_sp_plus_ratings()`, a function that allows a user to get Simple Rating System (SRS) ratings data, directly from the CFBD API.
- Updated the package version to `0.0.20`.
Expand All @@ -24,14 +28,14 @@
- Implemented `cfbd_json_py.stats.get_cfbd_advanced_team_game_stats()`, a function that allows a user to get advanced CFB team game stats, from the CFBD API.
- Implemented `cfbd_json_py.stats.get_cfbd_advanced_team_season_stats()`, a function that allows a user to get advanced CFB team season stats, from the CFBD API.
- Implemented `cfbd_json_py.stats.get_cfbd_team_season_stats()`, a function that allows a user to get CFB team season stats, from the CFBD API.
- Implemented `cfbd_json_py.metrics.get_cfbd_fg_expected_points()`, a fucntion based off of the recently added `/metrics/fg/ep` endpoint to the CFBD API in version `4.5.2`, which returns the expected points of a field goal for every yard line on a football field.
- Implemented `cfbd_json_py.metrics.get_cfbd_fg_expected_points()`, a function based off of the recently added `/metrics/fg/ep` endpoint to the CFBD API in version `4.5.2`, which returns the expected points of a field goal for every yard line on a football field.
- Updated the package's GitHub repo to identify the current version of the CFBD API as `"4.5.2"` instead of `"4.5.1"`
- Updated the package version to `0.0.19`.


## 0.0.18: The "recruiting" Update
- Implemented `cfbd_json_py.recruiting.get_cfbd_team_recruiting_group_ratings()`, a function that allows a user to get CFB recruiting data, grouped by the team and position, from the CFBD API.
- Implemented `cfbd_json_py.recruiting.get_cfbd_team_recruiting_ratings()`, a function that allows a user to get team recruting rankings, from the CFBD API.
- Implemented `cfbd_json_py.recruiting.get_cfbd_team_recruiting_ratings()`, a function that allows a user to get team recruiting rankings, from the CFBD API.
- Implemented `cfbd_json_py.recruiting.get_cfbd_player_recruit_ratings()`, a function that allows a user to get a list of players recruited to CFB teams, from the CFBD API.
- Updated the package version to `0.0.18`.

Expand All @@ -44,7 +48,7 @@
- Updated the package version to `0.0.17`.

## 0.0.16: The "Maintenance" Update
- **NOTE**: This update is to push the prevous `0.0.15` update to PyPi.
- **NOTE**: This update is to push the previous `0.0.15` update to PyPi.
- Implemented `cfbd_json_py.teams.get_cfbd_team_information()`, a function that allows a user to get CFB team information from the CFBD API.
- Updated the package version to `0.0.16`.

Expand Down Expand Up @@ -79,7 +83,7 @@
- Implemented `cfbd_json_py.players.get_cfbd_player_usage()`, a function that allows a user to get player usage data from the CFBD API.
- Implemented `cfbd_json_py.players.get_cfbd_pregame_win_probability_data()`, a function that allows a user to lookup known players in the CFBD API.
- Updated the function descriptions for `cfbd_json_py.games.get_cfbd_player_game_stats()`, and added a `["season"]` column to the function's output, should `return_as_dict = False`.
- Updated the validation logic for the `season` input variable for the following functions, by alowing a user to lookup data for the next CFB season:
- Updated the validation logic for the `season` input variable for the following functions, by allowing a user to lookup data for the next CFB season:
- `cfbd_json_py.drives.get_cfbd_drives_info()`
- `cfbd_json_py.games.get_cfbd_games()`
- `cfbd_json_py.games.get_cfbd_season_weeks()`
Expand Down Expand Up @@ -117,12 +121,12 @@

## 0.0.8: The "Games" Update

- Implemented `cfbd_json_py.games.get_cfbd_player_advanced_game_stats()`, a function that allows a user to get advanced player game stats for actual CFB games in a specific timeframe, from the CFBD API.
- Implemented `cfbd_json_py.games.get_cfbd_player_game_stats()`, a function that allows a user to get player game stats for actual CFB games in a specific timeframe, from the CFBD API.
- Implemented `cfbd_json_py.games.get_cfbd_game_media_info()`, a function that allows a user to get a list of known broadcasters for actual CFB games in a specific timeframe, from the CFBD API.
- Implemented `cfbd_json_py.games.get_cfbd_season_weeks()`, a function that allows a user to get a list of weeks that occured in a given CFB season from the CFBD API.
- Implemented `cfbd_json_py.games.get_cfbd_player_advanced_game_stats()`, a function that allows a user to get advanced player game stats for actual CFB games in a specific time frame, from the CFBD API.
- Implemented `cfbd_json_py.games.get_cfbd_player_game_stats()`, a function that allows a user to get player game stats for actual CFB games in a specific time frame, from the CFBD API.
- Implemented `cfbd_json_py.games.get_cfbd_game_media_info()`, a function that allows a user to get a list of known broadcasters for actual CFB games in a specific time frame, from the CFBD API.
- Implemented `cfbd_json_py.games.get_cfbd_season_weeks()`, a function that allows a user to get a list of weeks that occurred in a given CFB season from the CFBD API.
- Implemented `cfbd_json_py.games.get_cfbd_team_records()`, a function that allows a user to get team records data from the CFBD API.
- Fixed multiple bugs that would prevent a user from properly calling `cfbd_json_py.games.get_cfbd_games()` in certian edge cases.
- Fixed multiple bugs that would prevent a user from properly calling `cfbd_json_py.games.get_cfbd_games()` in certain edge cases.
- Attempted a fix for the `generate_docs.yml` GitHub Workflow to allow it to call `pdoc` properly within GitHub Actions.
- Updated the package version to `0.0.8`.

Expand All @@ -131,8 +135,8 @@
- Implemented `cfbd_json_py.games.get_cfbd_games()`, a function that allows a user to get game/schedule data from the CFBD API.
- Added a Docs webpage framework to this package by using [pdoc](https://pdoc.dev/)
- Added `cfbd_json_py._early_access`, a section specifically for CFBD API endpoints that exist, but aren't implemented yet by this python package.
- Added python file descriptors to track changes, detail when a file was first created, and explian the python file's purpose.
- Implemented the `check_cfbd_api_compatability.py` python script, a script that checks if this python package is compatible with the most recent version of the CFBD API, and raises a `ValueError()` if that isn't the case.
- Added python file descriptors to track changes, detail when a file was first created, and explain the python file's purpose.
- Implemented the `check_cfbd_api_compatibility.py` python script, a script that checks if this python package is compatible with the most recent version of the CFBD API, and raises a `ValueError()` if that isn't the case.
- Updated the package version to `0.0.7`.

## 0.0.6: The "Drives" Update.
Expand All @@ -155,14 +159,14 @@

## 0.0.4: The "Conferences" Update.

- Implemented `cfbd_json_py.conferences.get_cfbd_conference_info()`, a function that allows a user to get CFB confrence info from the CFBD API.
- Implemented `cfbd_json_py.conferences.get_cfbd_conference_info()`, a function that allows a user to get CFB conference info from the CFBD API.
- Updated the package version to `0.0.4`.

## 0.0.3: The "Coaches" Update.

- Implemented `cfbd_json_py.coaches.get_cfbd_coaches_info()`, a function that allows a user to get CFB head coach information from a specified season, timeframe, team, or name.
- Implemented `cfbd_json_py.coaches.get_cfbd_coaches_info()`, a function that allows a user to get CFB head coach information from a specified season, time frame, team, or name.
- Updated the sample script found in the help guide for `cfbd_json_py.betting.get_cfbd_betting_lines()`.
- Fixed a bug in `cfbd_json_py.betting.get_cfbd_betting_lines()` that would always result in the function not recognizing if the inputed `api_key` is the placeholder key inside the sample script for this function.
- Fixed a bug in `cfbd_json_py.betting.get_cfbd_betting_lines()` that would always result in the function not recognizing if the imputed `api_key` is the placeholder key inside the sample script for this function.
- Updated the package version to `0.0.3`.

## 0.0.2: The "Betting" Update.
Expand Down
2 changes: 1 addition & 1 deletion cfbd_api_version.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"current_verson": "4.5.2"
"current_version": "4.5.2"
}
14 changes: 7 additions & 7 deletions cfbd_json_py/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Creation Date: 08/30/2023 01:13 EDT
# Last Updated Date: 02/24/2023 03:30 PM EST
# Last Updated Date: 04/04/2024 05:10 PM EDT
# Author: Joseph Armstrong ([email protected])
# File Name: __init__.py
# Purpose: Allows for the python package to function,
Expand All @@ -16,19 +16,19 @@
- `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 confrences.
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 datapoints pertaining to
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 retrive various advanced metrics
or retrieve various advanced metrics
from the CFBD API.
- `cfbd_json_py.players`:
Holds functions for you to get various
Expand All @@ -44,7 +44,7 @@
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 recruting data and information,
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.
Expand All @@ -64,7 +64,7 @@
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 reccomended, extreme security risk).
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,
Expand All @@ -87,7 +87,7 @@
```
> **NOTE:** *In a future version,
there will be an executable application seperate from this package
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).*
Expand Down
32 changes: 11 additions & 21 deletions cfbd_json_py/betting.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""
# Creation Date: 08/30/2023 01:13 EDT
# Last Updated Date: 02/24/2023 03:30 PM EST
# Last Updated Date: 04/04/2024 05:10 PM EDT
# Author: Joseph Armstrong ([email protected])
# File Name: betting.py
# Purpose: Houses functions pertaining to betting data within the CFBD API.
Expand Down Expand Up @@ -35,14 +35,14 @@ def get_cfbd_betting_lines(
return_as_dict: bool = False,
):
"""
Retrives betting information from the CFBD API for a given season,
Retrieves betting information from the CFBD API for a given season,
or you could only get betting information for a single game.
Parameters
----------
`season` (int, mandatory):
The season you want to retrive betting information from.
The season you want to retrieve betting information from.
`api_key` (str, optional):
Semi-optional argument.
Expand All @@ -66,7 +66,7 @@ def get_cfbd_betting_lines(
Optional argument.
If `game_id` is set to a game ID,
`get_cfb_betting_lines()` will try to get
all betting informaiton for that game ID.
all betting information for that game ID.
`week` (int, optional):
Optional argument.
Expand All @@ -75,7 +75,7 @@ def get_cfbd_betting_lines(
`season_type` (str, semi-optional):
Semi-optional argument.
By defualt, this will be set to "regular", for the CFB regular season.
By default, this will be set to "regular", for the CFB regular season.
If you want postseason betting data, set `season_type` to "postseason".
If `season_type` is set to anything but "regular" or "postseason",
a `ValueError()` will be raised.
Expand Down Expand Up @@ -105,9 +105,9 @@ def get_cfbd_betting_lines(
`conference` (str, optional):
Optional argument.
If you only want betting information from games
involving teams a specific confrence,
involving teams a specific conference,
set `conference` to the abbreviation
of the conference you want betting informaiton from.
of the conference you want betting information from.
`year` (int):
Alternative keyword for `season`
Expand All @@ -132,9 +132,9 @@ def get_cfbd_betting_lines(
from cfbd_json_py.betting import get_cfbd_betting_lines
cfbd_key = "tigersAreAwsome" # placeholder for your CFBD API Key.
cfbd_key = "tigersAreAwesome" # placeholder for your CFBD API Key.
if cfbd_key is not "tigersAreAwsome":
if cfbd_key is not "tigersAreAwesome":
print(
"Using the user's API key declared " +
"in this script for this example."
Expand Down Expand Up @@ -252,7 +252,7 @@ def get_cfbd_betting_lines(
# you could just call these functions directly,
# without setting the API key in the script.
print(
"Using the user's API key suposedly loaded " +
"Using the user's API key supposedly loaded " +
"into this python environment for this example."
)
Expand Down Expand Up @@ -402,16 +402,6 @@ def get_cfbd_betting_lines(
elif away is not None:
away_team = away

# if conference is not None and conference is not None \
# and (conferenceis notconference):
# raise ValueError(
# "Inconsistent inputs for `conference` and `conference`."+
# "\nPlease use either `conference` OR `conference` "+
# "when calling this function"
# )
# elif conference is not None:
# conference = conference

del year, home, away

if game_id is not None and season is not None:
Expand Down Expand Up @@ -439,7 +429,7 @@ def get_cfbd_betting_lines(
else:
real_api_key = get_cfbd_api_token(api_key_dir=api_key_dir)

if real_api_key == "tigersAreAwsome":
if real_api_key == "tigersAreAwesome":
raise ValueError(
"You actually need to change `cfbd_key` to your CFBD API key."
)
Expand Down
20 changes: 10 additions & 10 deletions cfbd_json_py/coaches.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""
# Creation Date: 08/30/2023 01:13 EDT
# Last Updated Date: 02/24/2023 03:30 PM EST
# Last Updated Date: 04/04/2024 05:10 PM EDT
# Author: Joseph Armstrong ([email protected])
# File Name: coaches.py
# Purpose: Houses functions pertaining to coaching data within the CFBD API.
Expand Down Expand Up @@ -30,7 +30,7 @@ def get_cfbd_coaches_info(
return_as_dict: bool = False,
):
"""
Retrives information from the CFBD API on CFB Head Coaches.
Retrieves information from the CFBD API on CFB Head Coaches.
Parameters
----------
Expand Down Expand Up @@ -101,9 +101,9 @@ def get_cfbd_coaches_info(
from cfbd_json_py.coaches import get_cfbd_coaches_info
cfbd_key = "tigersAreAwsome" # placeholder for your CFBD API Key.
cfbd_key = "tigersAreAwesome" # placeholder for your CFBD API Key.
if cfbd_key is not "tigersAreAwsome":
if cfbd_key is not "tigersAreAwesome":
print(
"Using the user's API key declared in this script "+
"for this example."
Expand Down Expand Up @@ -189,7 +189,7 @@ def get_cfbd_coaches_info(
# you could just call these functions directly,
# without setting the API key in the script.
print(
"Using the user's API key suposedly loaded " +
"Using the user's API key supposedly loaded " +
"into this python environment for this example."
)
Expand Down Expand Up @@ -298,7 +298,7 @@ def get_cfbd_coaches_info(
else:
real_api_key = get_cfbd_api_token(api_key_dir=api_key_dir)

if real_api_key == "tigersAreAwsome":
if real_api_key == "tigersAreAwesome":
raise ValueError(
"You actually need to change `cfbd_key` to your CFBD API key."
)
Expand Down Expand Up @@ -327,15 +327,15 @@ def get_cfbd_coaches_info(
logging.warning(
"If you only want coaching information for a single season, "
+ "and not for a range of seasons, only set `year` "
+ "to the seaon you want coaching info for, "
+ "to the season you want coaching info for, "
+ "and leave `min_season` and `max_season` as `None` (NULL)."
)
min_season = None
elif season is None:
logging.warning(
"If you only want coaching information for a single season, "
+ "and not for a range of seasons, only set `year` to "
+ "the seaon you want coaching info for, "
+ "the season you want coaching info for, "
+ "and leave `min_season` and `max_season` as `None` (NULL)."
)
season = min_season
Expand All @@ -360,15 +360,15 @@ def get_cfbd_coaches_info(
logging.warning(
"If you only want coaching information for "
+ "a single season, and not for a range of seasons, "
+ "only set `year` to the seaon you want coaching info for, "
+ "only set `year` to the season you want coaching info for, "
+ "and leave `min_season` and `max_season` as `None` (NULL)."
)
min_season = None
elif season is None:
logging.warning(
"If you only want coaching information for "
+ "a single season, and not for a range of seasons, "
+ "only set `year` to the seaon you want coaching info for, "
+ "only set `year` to the season you want coaching info for, "
+ "and leave `min_season` and `max_season` as `None` (NULL)."
)
season = max_season
Expand Down
Loading

0 comments on commit 44b6c5a

Please sign in to comment.