Skip to main content

This library consists of obtaining data from an open database "statsbombpy".

Project description

DataStats

A package to make easier the obtention of data from the database "statsbombpy"

STATSBOMB

DataStats is a library that makes your life easier when you want to get data from the open source, helping you to get organized data instead of pulling the data in a unique way from game to game so you can pull an entire season for example.

Instalation

To install this library the easiest way to do it is via PyPi:

pip install DataStats

Source code

You can check the latest sources with the command:

git clone https://github.com/pauloo1010/Paulo-Inigo-Progra.git

Files

  • DataStats folder:
    1. DataStats .py: Code of all the library that will be explained in the Features section
    1. __ init__.py: Import of the library
  • LICENSE.txt: Copyright license
  • setup.cfg: Description file
  • setup .py: This file contains information about the package that PyPi needs

Features

In this library, three different functions have been used within the created class:

  1. The function selection returns a df with needed information for the other two functions as competition_id or season_id.

  2. The function matches returns another df that contains every match from the season that you have specified before, this process is made possible by the innformation that selection has provided.

  3. The last funtion events returns a list with two different dictionaries inside. In the first dictionary the keys are the ids of the match_id and the information inside each key is a dictionary with the information of all the existing tables of that match. The keys of the second dictionary are the names of the tables and inside them are joined all the data from all the matches.

Example

Importing library:

from DataStats import StatsObtention  

In the following command within the brackets you can enter different values. In case you enter a wrong one, this library will help you by telling the possible values you have for each case:

image

a = StatsObtention('La Liga', 'male', '2009/2010')

To know the usefulness of the commands that are going to be presented in the following boxes, you can refer to the information in the section of "Features".

a.selection()

image

a.matches()

image

This command has two processes that are carried out as shown in the following screenshots, the first one consists of creating the first dictionary that has been discussed in the "Features" section and the second one consists of creating the second dictionary that is also explained in the same section as the previous one.

a.events()

image

image

image

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

DataStats-0.4.tar.gz (4.5 kB view hashes)

Uploaded Source

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