Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Web-scraped Transfermarkt data for all soccer/football transfers in 10 European leagues over 30 seasons

License

NotificationsYou must be signed in to change notification settings

emordonez/transfermarkt-transfers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

All soccer/football club transfers from 1992/93–2020/21 for 10 of the top European leagues, namely

  1. Premier League 🏴󠁧󠁢󠁥󠁮󠁧󠁿
  2. La Liga 🇪🇸
  3. Bundesliga 🇩🇪
  4. Serie A 🇮🇹
  5. Ligue 1 🇫🇷
  6. Primeira Liga 🇵🇹
  7. Eredivisie 🇳🇱
  8. Premier Liga* 🇷🇺
  9. Jupiler Pro League* 🇧🇪
  10. Scottish Premiership* 🏴󠁧󠁢󠁳󠁣󠁴󠁿

Data were obtained by web scraping league transfer data fromTransfermarkt.

*Transfermarkt does not provide data for the 2011/12 Premier Liga season, the 1992/93 and 1993/94 Jupiler Pro League seasons, or the 1992/93–2002/03 Scottish Premiership seasons.

Data

All data are provided in thedata directory and grouped into season subdirectories.Feel free to use this dataset for your own purposes!You can clone it ordownload it via DownGit.Consult theREADME for more information.

Usage

If you'd like to pull the raw data directly from the source or scrape data for other countries and leagues, you can use the Python script provided bytmtransfers.

Setup and running the script

Clone this repository and open a terminal in the cloned folder.First ensure all dependencies are met:

pip install -r requirements.txt

The module can now be run as a script from the top directory:

python -m tmtransfers

This launches a series of text prompts.You should see the following output to start:

Select currency (default is euro):[1] EUR €[2] GBP £[3] USD $===>

Follow the prompts to input your desired league parameters.Scraped data will then be written to CSVs in a createddata directory.

As an example, an output CSV for the Premier League's 2020/21 season with the default options and before cleaning should look like:

clubnameagenationalitypositionshort_posmarket_valuedealing_clubdealing_countryfeemovementwindowleagueseason
Arsenal FCThomas Partey27GhanaDefensive MidfieldDM€40.00mAtlético MadridSpain€50.00minsummerpremier-league2020
Arsenal FCGabriel22BrazilCentre-BackCB€20.00mLOSC LilleFrance€26.00minsummerpremier-league2020
Arsenal FCPablo Marí26SpainCentre-BackCB€4.80mFlamengoBrazil€5.00minsummerpremier-league2020
Arsenal FCRúnar Alex Rúnarsson25IcelandGoalkeeperGK€1.20mDijonFrance€2.00minsummerpremier-league2020
Arsenal FCCédric Soares28PortugalRight-BackRB€8.00mSouthamptonEnglandfree transferinsummerpremier-league2020

Note: If you run the script again and scrape data for the same league and same season, the existing CSV will be overwritten.Be sure to move or rename existing files if you need them as is before running the script again.

Using the module

If you'd like to use this module elsewhere, install it from the top directory with

pip install.

It provides two functions,scrape_transfermarkt andtidy_transfers.Use them like so:

importpandasimporttmtransfers# Web scrape data for a league not explicitly given in the script# Returns a Pandas dataframedf=tmtransfers.scrape_transfermarkt(league_name='championship',league_id='GB2',season_id='2005',write=True)# Clean the data# Returns another Pandas dataframetidy_df=tmtransfers.tidy_transfers(df)

See the documentation intmtransfers.py for more details.

Note: These functions have been tested for only the above leagues through the listed seasons.You'll have to browse Transfermarkt for what to input to scrape other countries and leagues.

Source

All data are scraped fromTransfermarkt according to theirterms of use.

About

Web-scraped Transfermarkt data for all soccer/football transfers in 10 European leagues over 30 seasons

Topics

Resources

License

Stars

Watchers

Forks

Languages


[8]ページ先頭

©2009-2025 Movatter.jp