Skip to main content

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


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.6.tar.gz (17.3 kB view details)

Uploaded Source

Built Distribution

fusion_stat-0.0.6-py3-none-any.whl (26.0 kB view details)

Uploaded Python 3

File details

Details for the file fusion_stat-0.0.6.tar.gz.

File metadata

  • Download URL: fusion_stat-0.0.6.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

Hashes for fusion_stat-0.0.6.tar.gz
Algorithm Hash digest
SHA256 f65d9856624ced567174d9f1a3c170c9ab507387b5551926e26c3c96303b4e5b
MD5 df269bcbcb24df2a0d75db741617a9fa
BLAKE2b-256 d6268f27ccf0a344c94d728b07e2e1dc49103b560f7b6a5aab533884cc83d85c

See more details on using hashes here.

File details

Details for the file fusion_stat-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: fusion_stat-0.0.6-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

Hashes for fusion_stat-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 d658469677ac86a91c126c3fe18ee447015988990d8f9d7f8d18f079c3999ca0
MD5 887732de10e9d9ada6bea16b1b891b4c
BLAKE2b-256 6bb8622069e44cc605f3df33febffefdeaf6ef361c8e56275a8daa0ef22f7ced

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page