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.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


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

Uploaded Source

Built Distribution

fusion_stat-0.0.3-py3-none-any.whl (22.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fusion_stat-0.0.3.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-1018-azure

File hashes

Hashes for fusion_stat-0.0.3.tar.gz
Algorithm Hash digest
SHA256 138195dedb1f0c074b4ae0877e0e0e2b77b948bcdbfedb2a02db20ecaedd9fa7
MD5 a710ee472ab8495972068af1a927e33b
BLAKE2b-256 b5ef1803d494ceaf98b1e5ed329d80794c8472e55213676f3d84c031a1a2ae32

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fusion_stat-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 22.1 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 4395f421c873624aa0ec5489262becf08352d75dfda24c43160dfc7516374dfd
MD5 ca0902e91ab518b710dffc364164a074
BLAKE2b-256 5111d46a23642314019fb190bb5272d7dd5854a2d15c33e8c12d4029c98ba2f2

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