nokeechia / football-API-client

An API wrapper for the API-football

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

footballAPIClient

A simple wrapper around the football API provided by @API-SPORTS. For full documentation on the API endpoints and subscription details, refer to API-FOOTBALL. Usage of this package requires any level of subscription and an API-KEY.

Installation

pip install footballapiclient

Usage

Create the client

from  footballAPIClient  import  footballAPI

fp  =  footballAPI.FootballAPI("api-sports", api_key="YOUR_API_KEY")

Arguments:
- account_type: Indicates weather the account is used from Rapid-API or from dashboard. It consists of values: "rapid-api", and "api-sports", passing values other than this will raise an error.
- api_key: Valid API key required, or, it must be accessible via API_KEY environment variable.

Examples

Getting the country data by calling the countries API.

print(fp.get_countries())


Arguments:
name: (optional) The name of the country  
code:  (optional) The Alpha2 code of the country 
search:  (optional) The name of the country
:return: Returns the Country json schema

Output:

{ "get": "countries", "parameters": { "name": "england" }, "errors": [], "results": 1, "paging": { "current": 1, "total": 1 }, "response": [ { "name": "England", "code": "GB", "flag": "https://media.api-sports.io/flags/gb.svg" } ] }

Development

  • Each PR should have a corresponding issue available in issue tracker of repository.
  • To raise a PR, fork football-API-client
  • Clone the project in your local machine
git clone https://github.com/rishavganguly007/football-API-client.git
cd football-API-client
  • Install requirements of project into virtual environment.
poetry install   # Poetry creates a virtual environment in your local
# NOTE: If poetry is not set in your $PATH variable you can use
# pip install poetry
  • To run the test framework you can use
poetry install --with test

About

An API wrapper for the API-football

License:MIT License


Languages

Language:Python 100.0%