Giter Site home page Giter Site logo

cfbd-python's Introduction

cfbd-python's People

Contributors

bluescar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cfbd-python's Issues

MetricsApi get_games_ppa some columns seem off

I'm seeing some odd behavior from this api call.

In [68]: df.iloc[0]
Out[68]:
id                                                         None
season                                                     2021
week                                                          1
team                                                       UCLA
conference                                               Pac-12
opponnent                                                  None
offense       {'overall': '0.39486870672823511422', 'passing...
defense       {'overall': '0.19714015202950945797', 'passing...
Name: 0, dtype: object

it returns id instead of gameId and returns None. Also opponnent is misspelled and returns None

It seems like the issue is with cfbd/models/game_ppa.py.

The model seems to have incorrect mappings.

    attribute_map = {
        'id': 'id',
        'season': 'season',
        'week': 'week',
        'team': 'team',
        'conference': 'conference',
        'opponnent': 'opponnent',
        'offense': 'offense',
        'defense': 'defense'
    }

I've opened a pull request to fix #5

ApiException: (401) Reason: Unauthorized HTTP response headers

Getting an unauthorized error when I call the MetricsApi, is anyone else experiencing this / know what the issue is?

import cfbd
configuration = cfbd.Configuration()
configuration.api_key['Authorization'] = 'XYZ'
configuration.api_key_prefix['Authorization'] = 'Bearer'

MetricsAPI

cfbd_metrics_api = cfbd.MetricsApi(cfbd.ApiClient(configuration))

kwargs for the api functions don't ignore None

if 'game_id' in params:

I hit this while testing the get_sp_ratings function where I set the team to None and the full rankings were not returned.

Ex.
def get_sp_rankings(year, team=None):
18 # create an instance of the API class
19 api_instance = cfbd.RatingsApi(cfbd.ApiClient(configuration))
20
21 sp_rankings = {}
22 try:
23 # Historical SP+ ratings
24 api_response = api_instance.get_sp_ratings(year=year, team=team)
25 #print(api_response)
26 #pprint(api_responsei)
27 for team in api_response[:-1]:
28 #print(team)
29 #print(team.team, team.ranking)
30 team_name = normalize_team_names(team.team)
31 sp_rankings[team_name] = str(int(team.ranking))
32
33 except ApiException as e:
34 print("Exception when calling RatingsApi->get_sp_ratings: %s\n" % e)
35
36 return sp_rankings
...
if name == "main":
76 y2018 = get_sp_rankings(2018)
77 print(y2018)

Output:
$ python3 cfbd_util.py
{}

504 Gateway Timeout

When attempting to pull data using the Stats API get_advanced_team_game_stats function, I am getting a 504 Gateway Timeout error. Other API calls like get_lines from the Bets API and get_games call from the Games API work just fine.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.