Giter VIP home page Giter VIP logo

cooperjaxc / ap-cfb-xc Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 531 KB

Python-based program to pull the AP NCAA college football rankings and score them in a cross-country race style to determine the best football conference in a given week.

Home Page: https://cooperconferencecolumn.wordpress.com/2019/08/19/ap-xc-an-update/

License: GNU General Public License v3.0

Python 100.00%
cfb college-football cross-country ncaaf python top25 xc

ap-cfb-xc's People

Contributors

aci-leecooper avatar cooperjaxc avatar dependabot[bot] avatar

Watchers

 avatar

ap-cfb-xc's Issues

`v1` tag

Tag, but do not release, a spot for v1 that includes the old BeautifulSoup HTML parsing version of the code. This will distinguish it from the eventual API-based v2.

Push weekly results to Twitter/X via API

Create a Twitter ( or "X") account for this work. Then tweet each week's results with graphs publicaly through the Twitter python API.

To what extent is this possible?

Beautiful Soup ESPN Scraping Outdated

Issue

ESPN's AP Top 25 website code routinely changes, breaking this repo's code each time. Thus, the master branch as of this posting is broken. And, it will likely return to being broken even if this version of the code is continued to be used.

Solution

Move to a more stable API-based method of gleaning the Top 25 + "others receiving votes" like is suggested in #7.

Move blog post to GitHub Pages

Establish a webpage directly out of this repository using GitHub Pages

TODO:

  • Establish the GitHub Page (see https://pages.github.com/?(null)).
  • Move old blog posts to a page on the website.
  • Summarize project in a new, overarching blog post on the website.
  • Include links to old rankings' data and XC scores
  • Include links to graphs for past seasons.

Notes on future development w/ `cfbd` API

This is the only place I know where I can leave a note-to-self quickly.

From ChatGPT on rewriting this package with the cfbd Python API:

Here's an example code snippet that retrieves the most recent AP Top 25 college football standings using the cfbd Python package and stores the results in a pandas dataframe:

import pandas as pd
from cfbd import AP_TOP_25

# Retrieve the AP Top 25 college football standings
standings = AP_TOP_25()

# Create empty lists to store the data
teams = []
votes = []
conferences = []

# Iterate through the standings and extract the required information
for team in standings:
    teams.append(team.team.full_name)
    votes.append(team.votes)
    conferences.append(team.team.conference)

# Create a pandas dataframe using the collected data
df = pd.DataFrame({'Team': teams, 'Votes': votes, 'Conference': conferences})

# Print the dataframe
print(df)

Make sure you have the cfbd package installed (pip install cfbd) before running the code. The code utilizes the AP_TOP_25() function from cfbd to retrieve the AP Top 25 standings. It then iterates through the standings, extracts the team name, votes received, and conference for each team, and stores them in separate lists. Finally, it creates a pandas dataframe using the collected data and prints the resulting dataframe.

Please note that the cfbd package relies on external APIs and the availability of data. Ensure you have an active internet connection to retrieve the latest standings.

No README

Add a README complete with a summary of the idea of the project complete with links to the blog, a rundown of how this code (v2) works, and embed this tweet!

Is this a real tweet? https://t.co/8doSdncTkA

โ€” Connor O'Gara (@cjogara) January 18, 2023
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

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.