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"
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:
-
- DataStats .py: Code of all the library that will be explained in the Features section
-
- __ 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:
-
The function selection returns a df with needed information for the other two functions as competition_id or season_id.
-
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.
-
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:
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()
a.matches()
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()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.