Skip to content

Commit

Permalink
Merge pull request #41 from armstjc/0.1.1-The-housekeeping-update
Browse files Browse the repository at this point in the history
0.1.1: The "housekeeping" update
  • Loading branch information
armstjc authored Feb 24, 2024
2 parents c4af474 + a52a085 commit 079673a
Show file tree
Hide file tree
Showing 40 changed files with 47,501 additions and 39,460 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG: cfbd_json_py

## 0.1.1: The "housekeeping" update
- Cleaned up the formatting of all functions and python code.
- Updated the package version to `0.1.1`.

## 0.1.0: The "beta release" update
- Optimized a number of functions in this python package by using `pandas.json_normalize()` instead of looping through the data for some functions.
- Finalized the python package so it can be used by others.
Expand Down
149 changes: 78 additions & 71 deletions cfbd_json_py/__init__.py
Original file line number Diff line number Diff line change
@@ -1,78 +1,82 @@
# Creation Date: 08/30/2023 01:13 EDT
# Last Updated Date: 10/20/2023 02:33 PM EDT
# Last Updated Date: 02/24/2023 03:30 PM EST
# Author: Joseph Armstrong ([email protected])
# File Name: __init__.py
# Purpose: Allows for the python package to function,
# by allowing you to to access functions within
# this package.
####################################################################################################
###############################################################################
"""
# 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`:
- `cfbd_json_py.betting`:
Holds functions for betting lines and betting data from the CFBD API.
- `cfbd_json_py.coaches`:
- `cfbd_json_py.coaches`:
Holds functions for you to get coaching data (past and present).
- `cfbd_json_py.conferences`:
- `cfbd_json_py.conferences`:
Holds functions for you to get information for CFB confrences.
- `cfbd_json_py.draft`:
Holds functions for you to get NFL draft information/data for
- `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
- `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
- `cfbd_json_py.games`:
Holds functions for you to get various datapoints 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
- `cfbd_json_py.metrics`:
Holds functions to allow you to calculate
or retrive various advanced metrics
from the CFBD API.
- `cfbd_json_py.players`:
Holds functions for you to get various
data endpoints related to player stats,
- `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,
- `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,
- `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
- `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 recruting data and information,
- `cfbd_json_py.recruiting`:
Holds functions for you to access CFB recruting data and information,
as well as team and player ratings for recruiting.
- `cfbd_json_py.stats`:
- `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,
- `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`:
- `cfbd_json_py.utls`:
Various utilities that can be used from this package.
Outside of `cfbd_json_py.utls.set_cfbd_api_token()`,
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
- `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 reccomended, extreme security risk).
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).
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,
- `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,
- 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:
```
Expand All @@ -82,49 +86,52 @@
set_cfbd_api_token(api_key=cfbd_api_key)
```
> **NOTE:** *In a future version,
> **NOTE:** *In a future version,
there will be an executable application seperate from this package
for Windows, Mac, and Linux users to effectively do the same thing
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
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.
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](https://api.collegefootballdata.com/api/docs/?url=/api-docs.json#/)
- If you want to see all CFBD API endpoints that are currently supported,
[click here](
https://api.collegefootballdata.com/api/docs/?url=/api-docs.json#/)
to access the current Swagger docs for the entire API.
- If you want to see the source code for this package,
[click here](https://github.com/armstjc/cfbd-json-py) to see the current stable build of this python package on GitHub.
- If you want to see the active changelog for this python package,
- If you want to see the source code for this package,
[click here](https://github.com/armstjc/cfbd-json-py)
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.
"""

# Generated Functions:
from cfbd_json_py._early_access import *
from cfbd_json_py._early_access import * # noqa: F403


# Fully Implemented Functions:
from cfbd_json_py.betting import *
from cfbd_json_py.coaches import *
from cfbd_json_py.conferences import *
from cfbd_json_py.draft import *
from cfbd_json_py.drives import *
from cfbd_json_py.games import *
from cfbd_json_py.metrics import *
from cfbd_json_py.players import *
from cfbd_json_py.plays import *
from cfbd_json_py.rankings import *
from cfbd_json_py.ratings import *
from cfbd_json_py.recruiting import *
from cfbd_json_py.stats import *
from cfbd_json_py.teams import *
from cfbd_json_py.venues import *
from cfbd_json_py.betting import * # noqa: F403
from cfbd_json_py.coaches import * # noqa: F403
from cfbd_json_py.conferences import * # noqa: F403
from cfbd_json_py.draft import * # noqa: F403
from cfbd_json_py.drives import * # noqa: F403
from cfbd_json_py.games import * # noqa: F403
from cfbd_json_py.metrics import * # noqa: F403
from cfbd_json_py.players import * # noqa: F403
from cfbd_json_py.plays import * # noqa: F403
from cfbd_json_py.rankings import * # noqa: F403
from cfbd_json_py.ratings import * # noqa: F403
from cfbd_json_py.recruiting import * # noqa: F403
from cfbd_json_py.stats import * # noqa: F403
from cfbd_json_py.teams import * # noqa: F403
from cfbd_json_py.venues import * # noqa: F403

# Utils

from cfbd_json_py.utls import *

from cfbd_json_py.utls import * # noqa: F403
17 changes: 14 additions & 3 deletions cfbd_json_py/_early_access.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,26 @@
"""
# Creation Date: 10/06/2023 07:33 PM EDT
# Last Updated Date: 02/24/2023 03:30 PM EST
# Author: Joseph Armstrong ([email protected])
# File Name: _early_access.py
# Purpose: Houses functions that have yet to be implemented yet for
this version of this python package
"""

# Creation Date: 10/06/2023 07:33 PM EDT
# Last Updated Date: 10/06/2023 08:00 PM EDT
# Author: Joseph Armstrong ([email protected])
# File Name: _early_access.py
# Purpose: Houses functions that have yet to be implemented yet for the
####################################################################################################
###############################################################################


def about_early_access_functions():
print(
"Early Access functions are functions generated by a generator script " +
"when an API endpoint is created, but not implemented yet by this python package."
"Early Access functions are functions "
+ "generated by a generator script "
+ "when an API endpoint is created, "
+ "but not implemented yet by this python package."
)


Expand Down
Loading

0 comments on commit 079673a

Please sign in to comment.