Skip to content

Commit

Permalink
v3.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
oseymour committed Dec 5, 2024
1 parent d64c001 commit 9c11fab
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 291 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[project]
# -- Metadata --------------------------------------------------------------------------------------
name = "ScraperFC"
version = "3.1.2"
version = "3.2.0"
description = "Package for scraping soccer data from a variety of sources."
readme = "README.md"
license = {file = "LICENSE"}
Expand Down
234 changes: 11 additions & 223 deletions test/dev_testing.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -23,242 +23,35 @@
"from selenium.webdriver.common.by import By\n",
"from bs4 import BeautifulSoup\n",
"from io import StringIO\n",
"import pandas as pd"
"import pandas as pd\n",
"import requests\n",
"from tqdm import tqdm\n",
"import time"
]
},
{
"cell_type": "code",
"execution_count": 63,
"execution_count": 6,
"metadata": {},
"outputs": [
{
"name": "stdout",
"name": "stderr",
"output_type": "stream",
"text": [
"Changed currency to usd.\n"
"c:\\Users\\osmou\\Documents\\GitHub\\ScraperFC\\test\\../src\\ScraperFC\\transfermarkt.py:97: UserWarning: No club links table found for 1901/02 Jupiler Pro League. Returning empty list.\n",
" warrnings.warn(\n"
]
}
],
"source": [
"cap = sfc.Capology()\n",
"salaries = cap.scrape_salaries(\"2022-23\", \"Bundesliga\", \"usd\")"
]
},
{
"cell_type": "code",
"execution_count": 64,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead tr th {\n",
" text-align: left;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr>\n",
" <th></th>\n",
" <th></th>\n",
" <th colspan=\"3\" halign=\"left\">EST. BASE SALARY</th>\n",
" <th colspan=\"3\" halign=\"left\">BIO</th>\n",
" <th></th>\n",
" </tr>\n",
" <tr>\n",
" <th></th>\n",
" <th>PLAYER</th>\n",
" <th>GROSS P/W\\n(USD)</th>\n",
" <th>GROSS P/Y\\n(USD)</th>\n",
" <th>ADJ. GROSS\\n(USD)</th>\n",
" <th>POS.</th>\n",
" <th>AGE</th>\n",
" <th>COUNTRY</th>\n",
" <th>CLUB</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>Sadio Mané</td>\n",
" <td>$ 455,932</td>\n",
" <td>$ 23,708,454</td>\n",
" <td>$ 23,708,454</td>\n",
" <td>F</td>\n",
" <td>30</td>\n",
" <td>Senegal</td>\n",
" <td>Bayern Munich</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>Manuel Neuer</td>\n",
" <td>$ 435,208</td>\n",
" <td>$ 22,630,797</td>\n",
" <td>$ 22,630,797</td>\n",
" <td>K</td>\n",
" <td>36</td>\n",
" <td>Germany</td>\n",
" <td>Bayern Munich</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>Thomas Müller</td>\n",
" <td>$ 424,846</td>\n",
" <td>$ 22,091,968</td>\n",
" <td>$ 22,091,968</td>\n",
" <td>F</td>\n",
" <td>33</td>\n",
" <td>Germany</td>\n",
" <td>Bayern Munich</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>Joshua Kimmich</td>\n",
" <td>$ 404,121</td>\n",
" <td>$ 21,014,312</td>\n",
" <td>$ 21,014,312</td>\n",
" <td>M</td>\n",
" <td>27</td>\n",
" <td>Germany</td>\n",
" <td>Bayern Munich</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>Serge Gnabry</td>\n",
" <td>$ 391,065</td>\n",
" <td>$ 20,335,388</td>\n",
" <td>$ 20,335,388</td>\n",
" <td>F</td>\n",
" <td>27</td>\n",
" <td>Germany</td>\n",
" <td>Bayern Munich</td>\n",
" </tr>\n",
" <tr>\n",
" <th>...</th>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>566</th>\n",
" <td>Florian Schock</td>\n",
" <td>$ 622</td>\n",
" <td>$ 32,330</td>\n",
" <td>$ 32,330</td>\n",
" <td>K</td>\n",
" <td>21</td>\n",
" <td>Germany</td>\n",
" <td>Stuttgart</td>\n",
" </tr>\n",
" <tr>\n",
" <th>567</th>\n",
" <td>Linus Gechter</td>\n",
" <td>$ 414</td>\n",
" <td>$ 21,553</td>\n",
" <td>$ 21,553</td>\n",
" <td>D</td>\n",
" <td>18</td>\n",
" <td>Germany</td>\n",
" <td>Hertha Berlin</td>\n",
" </tr>\n",
" <tr>\n",
" <th>568</th>\n",
" <td>Naouirou Ahamada</td>\n",
" <td>$ 414</td>\n",
" <td>$ 21,553</td>\n",
" <td>$ 21,553</td>\n",
" <td>M</td>\n",
" <td>20</td>\n",
" <td>France</td>\n",
" <td>Stuttgart</td>\n",
" </tr>\n",
" <tr>\n",
" <th>569</th>\n",
" <td>Daniel Klein</td>\n",
" <td>$ 414</td>\n",
" <td>$ 21,553</td>\n",
" <td>$ 21,553</td>\n",
" <td>K</td>\n",
" <td>21</td>\n",
" <td>Germany</td>\n",
" <td>Augsburg</td>\n",
" </tr>\n",
" <tr>\n",
" <th>570</th>\n",
" <td>Marcel Sabitzer</td>\n",
" <td>$ 0</td>\n",
" <td>$ 0</td>\n",
" <td>$ 0</td>\n",
" <td>M</td>\n",
" <td>28</td>\n",
" <td>Austria</td>\n",
" <td>Bayern Munich</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>571 rows × 8 columns</p>\n",
"</div>"
],
"text/plain": [
" EST. BASE SALARY \\\n",
" PLAYER GROSS P/W\\n(USD) GROSS P/Y\\n(USD) ADJ. GROSS\\n(USD) \n",
"0 Sadio Mané $ 455,932 $ 23,708,454 $ 23,708,454 \n",
"1 Manuel Neuer $ 435,208 $ 22,630,797 $ 22,630,797 \n",
"2 Thomas Müller $ 424,846 $ 22,091,968 $ 22,091,968 \n",
"3 Joshua Kimmich $ 404,121 $ 21,014,312 $ 21,014,312 \n",
"4 Serge Gnabry $ 391,065 $ 20,335,388 $ 20,335,388 \n",
".. ... ... ... ... \n",
"566 Florian Schock $ 622 $ 32,330 $ 32,330 \n",
"567 Linus Gechter $ 414 $ 21,553 $ 21,553 \n",
"568 Naouirou Ahamada $ 414 $ 21,553 $ 21,553 \n",
"569 Daniel Klein $ 414 $ 21,553 $ 21,553 \n",
"570 Marcel Sabitzer $ 0 $ 0 $ 0 \n",
"\n",
" BIO \n",
" POS. AGE COUNTRY CLUB \n",
"0 F 30 Senegal Bayern Munich \n",
"1 K 36 Germany Bayern Munich \n",
"2 F 33 Germany Bayern Munich \n",
"3 M 27 Germany Bayern Munich \n",
"4 F 27 Germany Bayern Munich \n",
".. ... .. ... ... \n",
"566 K 21 Germany Stuttgart \n",
"567 D 18 Germany Hertha Berlin \n",
"568 M 20 France Stuttgart \n",
"569 K 21 Germany Augsburg \n",
"570 M 28 Austria Bayern Munich \n",
"\n",
"[571 rows x 8 columns]"
]
},
"execution_count": 64,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"salaries"
"tm = sfc.Transfermarkt()\n",
"club_links = tm.get_club_links(\"1901/02\", \"Jupiler Pro League\")"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
Expand All @@ -273,11 +66,6 @@
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.0"
},
"vscode": {
"interpreter": {
"hash": "585a938ec471c889bf0cce0aed741a99eaf47ca09c0fa8393793bc5bfe77ba11"
}
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit 9c11fab

Please sign in to comment.