Package to get sport information
Project description
sportinf
Sportinf 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. Sportinf gets data from TheSportsDB API (<https://www.thesportsdb.com>).
Installation
Python >= 3.5
pip install sportinf
Usage
First things first we have to import class called SportInfo:
from sportinf 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 created 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 sportinf 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
Alexander Maudza <alex.maudza@gmail.com>
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
File details
Details for the file sportinf-1.1.1.tar.gz
.
File metadata
- Download URL: sportinf-1.1.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7474fb2d7899ce748c7e5119debf53302eb19c20f9ea2feafe89067fa4ab130a |
|
MD5 | dae0fdde94d65a67f8f9e7cb9b7118ab |
|
BLAKE2b-256 | 096215d61513397aa4b4901490e476f246347e0b9e86ea50a201c65734d75c57 |