Skip to main content

No project description provided

Project description

https://img.shields.io/github/license/MikeSmithEU/apisports.svg GitHub Workflow Status (branch) Documentation Status

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


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.1.1.tar.gz (121.7 kB view details)

Uploaded Source

Built Distribution

apisports-0.1.1-py3-none-any.whl (130.2 kB view details)

Uploaded Python 3

File details

Details for the file apisports-0.1.1.tar.gz.

File metadata

  • Download URL: apisports-0.1.1.tar.gz
  • Upload date:
  • Size: 121.7 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

Hashes for apisports-0.1.1.tar.gz
Algorithm Hash digest
SHA256 66f17d9bc9c8fa07ca5a6c58c5e15043088130220445bb43c3b1d09013ccedf3
MD5 99ad42a77cf0e7e340526b44a244ea3f
BLAKE2b-256 f7186aef72742a78e47161182a91c1fddfe0e86a20a4aa6b0be67653553e9c3f

See more details on using hashes here.

File details

Details for the file apisports-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: apisports-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 130.2 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

Hashes for apisports-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7996a65e56524aea00fb076dd1cded7be6ba55bcd5cef9b7d6050fd67e957ba3
MD5 774b88214a0b54d4f6e221f8d2efa29e
BLAKE2b-256 1d3a02f1783b217e619c48f0ef48a97026d1dfc85c6ac1d15ffea13ac1ada08a

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