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 details)

Uploaded Source

File details

Details for the file DataStats-0.4.tar.gz.

File metadata

  • Download URL: DataStats-0.4.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.7

File hashes

Hashes for DataStats-0.4.tar.gz
Algorithm Hash digest
SHA256 8dcfc9de4867b38624cb5d38f2d399e8539b41064ca36b9641bfda3b0a77ec12
MD5 55cf3073688d78ab8e9e852a04d8c717
BLAKE2b-256 fa1d9ca638a3b5e0e70ffad19226f4308e31093fbcd347cd0853d237d69dadb2

See more details on using hashes here.

Supported by

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