Scrape football data from multiple sources simultaneously.
Project description
fusion-stat
A football data scraper that can scrape data from multiple sources simultaneously.
Installation
pip install fusion-stat
Usage
from fusion_stat import Fusion
You can use it like this
async with Fusion() as fusion:
competitions = await fusion.get_competitions()
or
fusion = Fusion()
competitions = await fusion.get_competitions()
await fusion.close()
params = competitions.get_params()
pl_params = next(params)
pl_params
{'fotmob_id': '47',
'fbref_id': '9',
'fbref_path_name': 'Premier-League',
'official_name': 'Premier League',
'transfermarkt_id': 'GB1',
'transfermarkt_path_name': 'premier-league'}
The client uses httpx.AsyncClient, you can also customize parameters.
import httpx
client = httpx.AsyncClient()
async with Fusion(client=client) as fusion:
competition = await fusion.get_competition(**pl_params)
competition.info
{'id': '47',
'name': 'Premier League',
'logo': 'https://www.premierleague.com/resources/rebrand/v7.129.2/i/elements/pl-main-logo.png',
'type': 'league',
'season': '2023/2024',
'country_code': 'ENG',
'names': {'Premier League'},
'market_values': '€10.96bn',
'player_average_market_value': '€19.54m'}
competition.teams[1]
{'id': '8456',
'name': 'Manchester City',
'names': {'Man City', 'Manchester City'},
'played': 20,
'wins': 13,
'draws': 4,
'losses': 3,
'goals_for': 48,
'goals_against': 23,
'points': 43,
'country_code': 'ENG',
'market_values': '€1.29bn',
'logo': 'https://resources.premierleague.com/premierleague/badges/rb/t43.svg',
'shooting': {'shots': 333, 'xg': 39.7}}
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
fusion_stat-0.0.7.tar.gz
(17.3 kB
view details)
Built Distribution
File details
Details for the file fusion_stat-0.0.7.tar.gz
.
File metadata
- Download URL: fusion_stat-0.0.7.tar.gz
- Upload date:
- Size: 17.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.11.0 Linux/6.2.0-1018-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 664dbc162ad9c2b9ae235f62e12f4c053145cd9a7b6e9d4cf2d6264f82ac8369 |
|
MD5 | 527399b81d9602bae985d72b24632070 |
|
BLAKE2b-256 | 873ded05f3d6b19c4e7804a952980e0a4a65587ea4b62d7d4cb4b6d20ab2f593 |
File details
Details for the file fusion_stat-0.0.7-py3-none-any.whl
.
File metadata
- Download URL: fusion_stat-0.0.7-py3-none-any.whl
- Upload date:
- Size: 26.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.11.0 Linux/6.2.0-1018-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c76666f07a62832eaddc1d1b4c0813a4d6be3882b75826dc42492730275b6d30 |
|
MD5 | b90142a96746604d8d4449326b3300ca |
|
BLAKE2b-256 | 29fc53e416ca96a09c8440728884f740b9074a6d1fe0d2faeb9ac06a1d92be01 |