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 Competitions, Competition
You can use it like this
competitions = Competitions()
fusion = await competitions.gather()
index = fusion.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:
competition = Competition(
**index[0],
client=client,
)
fusion = await competition.gather()
fusion.info
{'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'}}
fusion.teams[3]
{'name': 'Arsenal',
'names': {'Arsenal'},
'played': 11,
'wins': 7,
'draws': 3,
'losses': 1,
'goals_for': 23,
'goals_against': 9,
'points': 24,
'logo': 'https://resources.premierleague.com/premierleague/badges/rb/t3.svg',
'shooting': {'shots': 152.0, 'xg': 19.2}}
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.1.tar.gz
(13.6 kB
view details)
Built Distribution
File details
Details for the file fusion_stat-0.0.1.tar.gz
.
File metadata
- Download URL: fusion_stat-0.0.1.tar.gz
- Upload date:
- Size: 13.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.11.0 Linux/6.2.0-1016-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2df2c99eaed42e4e7633c06a25f3f5ce30d5f6674048d5c419c919f7c68f1245 |
|
MD5 | 1cc5b0281c391db86b1100c850a79423 |
|
BLAKE2b-256 | 5bd0e81a8c93713761b95d3da6d153d3feb2cc502e822775918966d5c158647b |
File details
Details for the file fusion_stat-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: fusion_stat-0.0.1-py3-none-any.whl
- Upload date:
- Size: 22.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.11.0 Linux/6.2.0-1016-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8979e4d4c291ef0efe6b2f959024a0b09b6d545f701a9ea7dd74f8b47070471d |
|
MD5 | a9318222663adbd2d44729aa70d3bf52 |
|
BLAKE2b-256 | bb64e369d9aee1597cfd295f77d29fc42f4e98509ee40ef2ca1cb2a1b5f73113 |