Skip to main content

A scraper of soccer data from FBref.

Project description

FBrefData is a scraper of football data from FBref. The library is forked from SoccerData by @probberechts.

Why FBrefData?

While SoccerData does a great job at scraping data from FBref, it has some limitations that I wanted to address. These limitations are, likely, due to the fact that it was originally built to scrape and combine data from different sources, which is why this library focuses on FBref only.

Some of the changes I wanted to introduce in FBrefData are:

  • I wanted to store the dataframes that are obtained from scraping instead of storing the HTML pages themselves, thus reducing the amount of disk space required to cache the data;
  • I wanted to support all competitions for which FBref provides advance stats data, including the ones in the Southern emisphere and the Major League Soccer, and not just the top five European leagues;
  • I wanted to remove the leagues selected by default, thus giving the users full control of which leagues they want to scrape.

FBrefData forked from version 1.4.1 of SoccerData and will start its versioning from 0.1.0. The improvements listed above, along with other minor changes, will be officially available starting from version 1.0.0. Nonetheless, I will still merge improvements made to the FBref module of SoccerData for as long as it's possible.

Installation

pip install fbrefdata

Usage

import fbrefdata as fd

# Create scraper class instance for the 2018-2019 Premier League
fbref = fd.FBref('ENG-Premier League', '2018-2019')

# Fetch dataframes
schedule = fbref.read_schedule()

Supported leagues

As of now, FBrefData supports the following leagues:

  • Argentina: Primera División
  • Belgium: Pro League
  • Brazil: Série A
  • England: Premier League, EFL Championship
  • France: Ligue 1, Ligue 2
  • Germany: Fußball-Bundesliga, 2. Fußball-Bundesliga
  • Italy: Serie A, Serie B
  • Mexico: Liga MX
  • Netherlands: Eredivisie
  • Portugal: Primeira Liga
  • Spain: La Liga, Segunda División
  • United States/Canada: Major League Soccer
  • UEFA: Champions League, Europa League, Europa Conference League
  • CONMEBOL: Copa Libertadores

If FBref started providing advanced stats for leagues that aren't supported yet, please open an issue.


Disclaimer: As this library relies on web scraping, any changes to the scraped websites will break the package. Hence, do not expect that all code will work all the time. If you spot any bugs, then please fork it and start a pull request.

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

fbrefdata-0.4.1.tar.gz (20.7 kB view details)

Uploaded Source

Built Distribution

fbrefdata-0.4.1-py3-none-any.whl (21.1 kB view details)

Uploaded Python 3

File details

Details for the file fbrefdata-0.4.1.tar.gz.

File metadata

  • Download URL: fbrefdata-0.4.1.tar.gz
  • Upload date:
  • Size: 20.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.5

File hashes

Hashes for fbrefdata-0.4.1.tar.gz
Algorithm Hash digest
SHA256 9c94d50673da062449f73c9d07627a250c479d4cb15fa0a95edbb86d93824fec
MD5 4edf49195ede2984bc2d1aa0b700d715
BLAKE2b-256 d1d95951aa77e33749d76575d889269a521b891c060ad2f6260aa2c8e2bb84b1

See more details on using hashes here.

File details

Details for the file fbrefdata-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: fbrefdata-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 21.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.5

File hashes

Hashes for fbrefdata-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f115051c6e5a1c549f7d8f9f826010d3f1dbb9ea39f1a43d076f0a9ea92a430a
MD5 244d30d6359f75a2f8024fa267532fad
BLAKE2b-256 a8417b9f3c41200dfddd47295435913df6602ab12e7fb8eea21c12839b5a3a02

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