API client for SofaScore soccer data
Project description
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
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file aiosofascore-0.0.7.0.tar.gz.
File metadata
- Download URL: aiosofascore-0.0.7.0.tar.gz
- Upload date:
- Size: 8.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
624c9b511237e2231e46ecb6d387c04714c751b68ab144ed9f17453dc95bd4a6
|
|
| MD5 |
4c4bc30ba9cfb84da53d5d9f600fafac
|
|
| BLAKE2b-256 |
08645b2f4bfac629ff68bb94f9f9fc089362c24eb773f6fb003834b2bafb4d05
|
File details
Details for the file aiosofascore-0.0.7.0-py3-none-any.whl.
File metadata
- Download URL: aiosofascore-0.0.7.0-py3-none-any.whl
- Upload date:
- Size: 9.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b3e9977b0bd64b1e418b132b095de599c2889bb316692595bf8763e4aeb51ccf
|
|
| MD5 |
8a79c97fec6d5e7bce7c59bb7ffe3e71
|
|
| BLAKE2b-256 |
237eb569e9fb63660ba95a8b3c31d98e38b34dd1c303fd71379d06b57016a672
|