No project description provided
Project description
A simple python library for easy querying of APISports data.
Example usage
from apisports import Football
api = Football(api_key='XXXXXXXX')
# get all players for Chelsea FC (id=49) for the 2020 season
# and sort by age
players = api.players(season=2020, team=49)
if not players.ok:
print("something went wrong: " + players.error_description)
else:
sorted_by_age = sorted(players, key=lambda player : player['player']['age'])
def format_player(player):
return "{firstname} {lastname}: {age}".format(
firstname = player['player']['firstname'],
lastname = player['player']['lastname'],
age = player['player']['age']
)
for player in sorted_by_age:
print(format_player(player))
outputs:
Harvey Vale: 18 Dynel Simeu: 19 Myles Peart-Harris: 19 Ian Maatsen: 19 Valentino Livramento: 19 Lewis Bate: 19 Karlo Žiger: 20 Henry Lawrence: 20 Billy Gilmour: 20 Faustino Anjorin: 20 Armando Broja: 20 Marc Guehi: 21 Conor Gallagher: 21 Tariq Lamptey: 21 Juan Familia-Castillo: 21 Ethan Ampadu: 21 Callum Hudson-Odoi: 21 Jamie Cumming: 22 Luke McCormick: 22 Kai Havertz: 22 Mason Mount: 22 Reece James: 22 Christian Pulisic: 23 Nathan Baxter: 23 Isaiah Brown: 24 Fikayo Tomori: 24 Jake Clarke-Salter: 24 Tammy Bakumo-Abraham: 24 Ruben Loftus-Cheek: 25 Robert Kenedy Nunes do Nascimento: 25 Ben Chilwell: 25 Timo Werner: 25 Andreas Bødtker Christensen: 25 Lewis Baker: 26 Kepa Arrizabalaga Revuelta: 27 Emerson Palmieri dos Santos: 27 Mateo Kovačić: 27 Kurt Happy Zouma: 27 Ross Barkley: 28 Hakim Ziyech: 28 Antonio Rüdiger: 28 Michy Batshuayi Tunga: 28 Davide Zappacosta: 29 Edouard Mendy: 29 Jorge Luiz Frello Filho: 30 N'Golo Kanté: 30 Victor Moses: 31 Marcos Alonso Mendoza: 31 César Azpilicueta Tanco: 32 Willian Borges da Silva: 33 Pedro Eliezer Rodríguez Ledesma: 34 Olivier Giroud: 35 Thiago Emiliano da Silva: 37 Wilfredo Daniel Caballero: 40
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.
Source Distribution
apisports-0.3.1.tar.gz
(122.4 kB
view details)
Built Distribution
apisports-0.3.1-py3-none-any.whl
(131.0 kB
view details)
File details
Details for the file apisports-0.3.1.tar.gz
.
File metadata
- Download URL: apisports-0.3.1.tar.gz
- Upload date:
- Size: 122.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.9.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b0d405e873ead520019f288b1a5fd75a0ba98552290edeb600d5e3ceb07540bd |
|
MD5 | 102cd1a34702aae4cabc2b48f18d254f |
|
BLAKE2b-256 | 65cfc8c620c5b94cb32e46105adf9eb565a49b64482a95cd674333d7fb29f717 |
File details
Details for the file apisports-0.3.1-py3-none-any.whl
.
File metadata
- Download URL: apisports-0.3.1-py3-none-any.whl
- Upload date:
- Size: 131.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.9.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 20d9ecf9330bc99ccbe687139b36c02285d5bcface455e2a3a21f99f25bb3ce5 |
|
MD5 | 33ace0089250550067b996993b333792 |
|
BLAKE2b-256 | 36746f6172917344e542ab36c70815d2ca8bc89748d171511351a643608bc90c |