Skip to main content

A library for pulling in and normalising sports stats.

Project description

sportsball

PyPi

A library for pulling in and normalising sports stats.

sportsball

Dependencies :globe_with_meridians:

Python 3.11.6:

Raison D'être :thought_balloon:

sportsball aims to be a library for pulling in historical information about previous sporting games in a standardised fashion for easy data processing. The models it uses are designed to be used for many different types of sports.

The supported leagues are:

Architecture :triangular_ruler:

sportsball is an object orientated library. The entities are organised like so:

  • League: The entry point to accessing data about a league.
    • Season: A season within a league.
      • Game: A game within a season.
        • Team: The team within the game. Note that in games with individual players a team exists as a wrapper.
          • Player: A player within the team.
          • Odds: The odds for the team to win the game.
            • Bookie: The bookie publishing the odds.
        • Venue: The venue the game was played in.
          • Address: The address information of a venue.

Caching

This library uses very aggressive caching due to the large data requirements. The initial data load will take some time however after that it will cache the old data for up to 1 year.

Installation :inbox_tray:

This is a python package hosted on pypi, so to install simply run the following command:

pip install sportsball

Usage example :eyes:

To pull a dataframe containing all the information for a particular league, the following example can be used:

import logging
import sportsball as spb

logging.basicConfig(level='DEBUG')
ball = spb.SportsBall()
league = ball.league(spb.League.NFL)
df = league.to_frame()

This results in a dataframe where each game is represented by all its features.

License :memo:

The project is available under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sportsball-0.0.1.tar.gz (11.5 kB view details)

Uploaded Source

File details

Details for the file sportsball-0.0.1.tar.gz.

File metadata

  • Download URL: sportsball-0.0.1.tar.gz
  • Upload date:
  • Size: 11.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.6

File hashes

Hashes for sportsball-0.0.1.tar.gz
Algorithm Hash digest
SHA256 a55020a0afc84e5af36f52824c6954c942ccbd7496d796385b0559425b8dc0e1
MD5 e1ee4ea19e4f440d4b0c1822582906ac
BLAKE2b-256 185fe32e8dea2fbdf6e09c55f61b182551128f22c01a656bc45b9477a2d743ac

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page