Skip to main content

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.

Metadata

Release files for fbrefdata 0.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fbrefdata 0.4.1
File Size Uploaded Provenance Actions
fbrefdata-0.4.1.tar.gz 20.7 kB Without provenance Details for fbrefdata-0.4.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for fbrefdata 0.4.1
File Interpreter ABI Platform Actions
fbrefdata-0.4.1-py3-none-any.whl Python 3 none any Details for fbrefdata-0.4.1-py3-none-any.whl

Total release size: 41.8 kB

Release files / fbrefdata-0.4.1.tar.gz

Download URL fbrefdata-0.4.1.tar.gz
Size 20.7 kB
Tags Source
SHA-256 checksum
How to use checksums
9c94d50673da062449f73c9d07627a250c479d4cb15fa0a95edbb86d93824fec
BLAKE2b-256 checksum
How to use checksums
d1d95951aa77e33749d76575d889269a521b891c060ad2f6260aa2c8e2bb84b1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.12.5

Release files / fbrefdata-0.4.1-py3-none-any.whl

Download URL fbrefdata-0.4.1-py3-none-any.whl
Size 21.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f115051c6e5a1c549f7d8f9f826010d3f1dbb9ea39f1a43d076f0a9ea92a430a
BLAKE2b-256 checksum
How to use checksums
a8417b9f3c41200dfddd47295435913df6602ab12e7fb8eea21c12839b5a3a02
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.12.5

Security for fbrefdata 0.4.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page