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, Competitions, Competition
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()
index = competitions.index()
index
[{'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(**index[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': '9825',
'name': 'Arsenal',
'names': {'Arsenal'},
'played': 16,
'wins': 11,
'draws': 3,
'losses': 2,
'goals_for': 33,
'goals_against': 15,
'points': 36,
'logo': 'https://resources.premierleague.com/premierleague/badges/rb/t3.svg',
'shooting': {'shots': 237.0, 'xg': 29.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.2.tar.gz
(13.3 kB
view details)
Built Distribution
File details
Details for the file fusion_stat-0.0.2.tar.gz
.
File metadata
- Download URL: fusion_stat-0.0.2.tar.gz
- Upload date:
- Size: 13.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 | f8b98edc6652aceda3f0cbb742eeca760f3db85aee847972bb21927cfba69e92 |
|
MD5 | 581f8279a5f0eac8220c0ebedd4078d5 |
|
BLAKE2b-256 | e2fde4a5211ac39e4c54b28c4b0f77465b17e5d40f4f551f78c3188fb714fd65 |
File details
Details for the file fusion_stat-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: fusion_stat-0.0.2-py3-none-any.whl
- Upload date:
- Size: 21.7 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 | 0e38c4cb1381f87dea4b04a9de239abd5a97b24e550b96d05106836b1ae566f8 |
|
MD5 | 509a2bb1f1fe442ee95ad8cb8cbeedcc |
|
BLAKE2b-256 | 71395e6bd83991fe9ea3fb08cbcb94f9a8deaf79f9f6cf10feb2311ab3a1fdfb |