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.aclose()
params = competitions.get_params()
params
[{'fotmob_id': '47',
'fbref_id': '9',
'fbref_path_name': 'Premier-League',
'official_name': 'Premier League'},
{'fotmob_id': '87',
'fbref_id': '12',
'fbref_path_name': 'La-Liga',
'official_name': 'La Liga'},
{'fotmob_id': '54',
'fbref_id': '20',
'fbref_path_name': 'Bundesliga',
'official_name': 'Bundesliga'},
{'fotmob_id': '55',
'fbref_id': '11',
'fbref_path_name': 'Serie-A',
'official_name': 'Serie A'},
{'fotmob_id': '53',
'fbref_id': '13',
'fbref_path_name': 'Ligue-1',
'official_name': 'Ligue 1'}]
You can also use it like this
import httpx
async with httpx.AsyncClient() as client:
fusion = Fusion(client=client)
competition = await fusion.get_competition(**params[0])
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',
'names': {'Premier League'}}
competition.teams[1]
{'id': '10252',
'name': 'Aston Villa',
'names': {'Aston Villa'},
'played': 20,
'wins': 13,
'draws': 3,
'losses': 4,
'goals_for': 43,
'goals_against': 27,
'points': 42,
'logo': 'https://resources.premierleague.com/premierleague/badges/rb/t7.svg',
'shooting': {'shots': 289, 'xg': 36.0}}
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.5.tar.gz
(14.4 kB
view details)
Built Distribution
File details
Details for the file fusion_stat-0.0.5.tar.gz
.
File metadata
- Download URL: fusion_stat-0.0.5.tar.gz
- Upload date:
- Size: 14.4 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 | b8527a9a45d77fc8a4a187f8eb99832cf3921b754f6a205dce8d385e6850f0e7 |
|
MD5 | c775f59b472e6a306ce943d2305ecd16 |
|
BLAKE2b-256 | d0502ed1c1d610bef8bb5c96d869bb6c587702396390c7551f1ca378f693b1f1 |
File details
Details for the file fusion_stat-0.0.5-py3-none-any.whl
.
File metadata
- Download URL: fusion_stat-0.0.5-py3-none-any.whl
- Upload date:
- Size: 22.6 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 | 89585ce06002eff7f880064edab793fe37843ec5b9277e16199cf37b6911630c |
|
MD5 | 2d70c1408a91c73357c42fb3b39c6f39 |
|
BLAKE2b-256 | a411937ef7aa4297be8009031859bf88ea8a12c522e323ad7cafe62368825d30 |