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
TODO
add unit tests
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.0.1.tar.gz
(8.2 kB
view details)
Built Distribution
File details
Details for the file apisports-0.0.1.tar.gz
.
File metadata
- Download URL: apisports-0.0.1.tar.gz
- Upload date:
- Size: 8.2 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 | 7f3c844f4d1c07cdd398ea4d745b11e2633d5c80cf92b140e23f34a1ffb106e7 |
|
MD5 | 64b4d8fed98128dd60c1457d1cfcfa0d |
|
BLAKE2b-256 | 4a7c6852b2ea8172627aefda580930e06887a547cf46d1379355b1db075e0f7f |
File details
Details for the file apisports-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: apisports-0.0.1-py3-none-any.whl
- Upload date:
- Size: 7.8 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 | d82a3df4b3a942162409ee401e89f16a58c039068e9ce4d1dbd08dfea6128bf6 |
|
MD5 | 04577fc72688f4ef04cf5981548d6fc6 |
|
BLAKE2b-256 | 58263df588d37b2b3abbe2091be533b0e3b2bc826afaf93db91f78aabcd59a6c |