Skip to main content

API client for SofaScore soccer data

Project description

PyPI Version LICENSE

Aiosofascore

Aiosofascore is an API client for SofaScore's soccer data, designed to provide easy access to soccer categories, tournaments, events, and much more. It is built with aiohttp for asynchronous HTTP requests and can be integrated into any Python project that needs soccer-related data.

Features

  • Fetch soccer categories and tournaments
  • Get detailed tournament standings and seasons
  • Retrieve pregame forms, head-to-head stats, and event managers
  • Built using Python's asynchronous capabilities with aiohttp

Installation

To install aiosofascore from PyPI, run the following command:

pip install aiosofascore

Usage Example

Here's how you can use aiosofascore to get data about football tournaments

import asyncio
from aiosofascore import BaseSoccerApi


async def main():
    # Create a client
    client = BaseSoccerApi()

    # Fetch categories
    categories = await client.get_categories()
    for category in categories:
        print(f"Category: {category.name}")

    # Fetch tournaments by category
    tournaments = await client.get_tournaments_by_category(categories[0])
    for tournament in tournaments:
        print(f"Tournament: {tournament.name}")


if __name__ == "__main__":
    asyncio.run(main())

Get event data

import asyncio
from aiosofascore import BaseSoccerApi


async def main():
    
    client = BaseSoccerApi()
    event = await client.get_event(event_id='13363911')
    print(event.home_team.name)
    print(event.away_team.name)


if __name__ == "__main__":
    asyncio.run(main())

License

This project is licensed under the MIT License — see the LICENSE file for details.

Contact

If you have any questions or suggestions, feel free to open an issue or contact me via vasilewskij.fil@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

aiosofascore-0.0.6.1.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aiosofascore-0.0.6.1-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file aiosofascore-0.0.6.1.tar.gz.

File metadata

  • Download URL: aiosofascore-0.0.6.1.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for aiosofascore-0.0.6.1.tar.gz
Algorithm Hash digest
SHA256 85c440a64e52007fb946952be21d0649801e5a2808bc4e073f768de51930649c
MD5 7ceaeba7dc854ec9deb7423749e7edba
BLAKE2b-256 3c59b4ac1ba064c61cf1c43caaef678ce1aa776a1a75f7c58fcd194ebc32e30e

See more details on using hashes here.

File details

Details for the file aiosofascore-0.0.6.1-py3-none-any.whl.

File metadata

  • Download URL: aiosofascore-0.0.6.1-py3-none-any.whl
  • Upload date:
  • Size: 9.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for aiosofascore-0.0.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2b95d5945e50dafd317280adf3b66da72cfde16d59b885a98167e5383ddd5d1b
MD5 d020a087cece7db0d568530be8665d45
BLAKE2b-256 cc4745134643b44e4e8cbc9514c554eb6e936abaee1cb13c84ae550d83f53e8a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page