Skip to main content

Package to get sport information

Project description

sporres

Sporres is a convenient python module to get data of sport teams, players, leagues and events. You can know information from many sports, such as: football, hockey, basketball, tennis, golf, athletics and so on. Sporres gets data from TheSportsDB API (<https://www.thesportsdb.com>).

Installation

Python >= 3.5

pip install sporres

Usage

First things first we have to import class called SportInfo:

from sporres import SportInfo

After this we make an object of this class:

info = SportInfo(option=”name of the option”, name_of_parameter=”value of the parameter”)

First parameter is option. This parameter shows what information you want to get. Here are all options that available in module and their description:

  • Information about team - shows an information about team. Requires name of the team.

  • Information about player - returns an information about player. Requires first and last name of the player.

  • Information about event - shows an information about event. Requires name of the event.

  • List all sports - returns list of all sports that available in this module. Requires nothing.

  • List all leagues - returns list of all leagues from any sport and country that available in this module. Requires nothing.

  • List all countries - returns list of all countries that available in this module. Requires nothing.

  • List all Seasons in a League - returns list of all seasons from any league that available in this module. Requires name of the league.

  • List all Teams in a League - returns list of all teams from any league that available in this module. Requires name of the league.

  • League Details - shows a detailed information about any league. Requires name of the league.

  • Player Honours - shows all honours that player got through his career. Requires first and last name of the player.

  • Player Former Teams - returns all former teams of player. Requires first and last name of the player.

  • Player Contracts - shows an information about contract by player. Requires first and last name of the player.

  • Lookup Table by League and Season - shows a table from any league and season. Requires name of the league and season.

  • Lookup Equipment by Team - returns an information about every equipment by team. Requires name of the team.

  • Last 15 Events by League - shows an information about 15 last events from any league. Requires name of the league.

When you createn an object of SportInfo class, you have to write only option and those parameters that are written in the description for every option. For example, you need to an information about player Lionel Messi. You have to write next:

info = SportInfo(option=”Information about player”, player_name=”Lionel Messi”)

You get a result as python dictionary. In this dictionary keys are parameters. For every option they are different. List of all parameters for every option you can find in parameters.txt. So, if you want to know an information for player Lionel Messi, you will result like in result_Lionel_Messi.txt.

Sometimes happens situation when you get more than one result. For instance, when you want to know information about team called Arsenal, you will get data about six teams, such as: Arsenal London, Arsenal U21, Arsenal WFC, Arsenal Kyiv, Arsenal Tula and Arsenal Sarandi. In this case sporres will return dictionary, where as a key will be name of the team, league, event etc. As a value will be dictionary with parameters and values of this one.

Configuration

There is nothing to configure

Credits

Contributors

Author & Maintainer

This module is maintained by Alexander Maudza

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

sportinf-1.0.1.tar.gz (131.3 kB view details)

Uploaded Source

File details

Details for the file sportinf-1.0.1.tar.gz.

File metadata

  • Download URL: sportinf-1.0.1.tar.gz
  • Upload date:
  • Size: 131.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.2

File hashes

Hashes for sportinf-1.0.1.tar.gz
Algorithm Hash digest
SHA256 7a35d9e5fe7a7e63e0625e67114148b9937c2dcfb69e5e3ceaa08369081cf75d
MD5 bfc878e0466a025f499a9abdd74d3433
BLAKE2b-256 738671e1477e780d34ca14f557077302de0d9450cfe883ce3cc9ebe317b1aafd

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