Skip to content

Commit

Permalink
Merge pull request #17 from ian-shepherd/development
Browse files Browse the repository at this point in the history
1.1.4 Update
  • Loading branch information
ian-shepherd authored Jan 15, 2024
2 parents 54155a4 + 4dcfc3c commit 4500623
Show file tree
Hide file tree
Showing 75 changed files with 27,317 additions and 4,038 deletions.
22 changes: 22 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
# Change Log

## 1.1.4 2024-01-15
* added fbref functions
* fb_player_match_logs_data
* fb_player_match_logs_defensive_actions
* fb_player_match_logs_gca_sca
* fb_player_match_logs_misc
* fb_player_match_logs_passing_type
* fb_player_match_logs_passing
* fb_player_match_logs_possession
* fb_player_match_logs_summary
* fb_player_scouting_report
* fm_match_data enhancement
* added team stats
* added momentum
* fixed transfermarkt bugs
* tm_player_market_value
* tm_player_metadata
* tm_player_transfers
* added transfermarkt functions
* tm_team_staff
* tm_team_staff_history

## 1.1.3 2023-06-30
* added github actions for testing
* deprecated fm_league_ids and fm_league_urls in favor of fm_leagues
Expand Down
2 changes: 1 addition & 1 deletion docs/.buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 1c55c12556785a221c2d6449c099212d
config: 28d6d53edbf470ad72b1b81cf715c8c3
tags: 645f666f9bcd5a90fca523b33c5a78b7
123 changes: 123 additions & 0 deletions docs/_sources/fbref.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,129 @@ League functions
:rtype: (list, list)


Player functions
----------------

.. py:function:: .fbref.fb_player_scouting_report(pageSoup=None, url: str = None, player_url: str = None, comp_league: str = None, position_comp: str = "Primary") -> dict
Extracts scouting report for a given player

:param pageSoup: bs4 object of a player's scouting report. Defaults to None.
:type pageSoup: bs4 or None
:param url: path of fbref scouting report page. Defaults to None.
:type url: str or None
:param player_url: path of fbref player page. Defaults to None.
:type player_url: str or None
:param comp_league: name of comparison league. Defaults to None.
:type comp_league: str or None
:param position_comp: primary or secondary position. Defaults to "Primary".
:type position_comp: str
:return: complete scouting report for a player
:rtype: dict

.. py:function:: .fbref.fb_player_match_logs_data(season_end: str, player_id: str) -> dict
Extracts scouting report for a given player

:param season_end: ending year of a season
:type season_end: str
:param player_id: unique identifier for a player
:type player_id: str
:return: match logs for a player in a given season
:rtype: dict[list]

.. py:function:: .fbref.fb_player_match_logs_defensive_actions(pageSoup=None, season_end: str = None, player_id: str = None) -> dict
Retrieves a players defensive actions match log for a given season

:param pageSoup: bs4 object of a players defensive actions match log page. Defaults to None.
:type pageSoup: bs4 or None
:param season_end: ending year of a season
:type season_end: str
:param player_id: unique identifier for a player
:type player_id: str
:return: defensive actions match log for a player in a given season
:rtype: list

.. py:function:: .fbref.fb_player_match_logs_gca_sca(pageSoup=None, season_end: str = None, player_id: str = None) -> dict
Retrieves a players goal and shot creating actions match log for a given season

:param pageSoup: bs4 object of a players goal and shot creating actions match log page. Defaults to None.
:type pageSoup: bs4 or None
:param season_end: ending year of a season
:type season_end: str
:param player_id: unique identifier for a player
:type player_id: str
:return: goal and shot creating actions match log for a player in a given season
:rtype: list

.. py:function:: .fbref.fb_player_match_logs_misc(pageSoup=None, season_end: str = None, player_id: str = None) -> dict
Retrieves a players miscellaneous match log for a given season

:param pageSoup: bs4 object of a players miscellaneous match log page. Defaults to None.
:type pageSoup: bs4 or None
:param season_end: ending year of a season
:type season_end: str
:param player_id: unique identifier for a player
:type player_id: str
:return: miscellaneous match log for a player in a given season
:rtype: list

.. py:function:: .fbref.fb_player_match_logs_passing(pageSoup=None, season_end: str = None, player_id: str = None) -> dict
Retrieves a players passing match log for a given season

:param pageSoup: bs4 object of a players passing match log page. Defaults to None.
:type pageSoup: bs4 or None
:param season_end: ending year of a season
:type season_end: str
:param player_id: unique identifier for a player
:type player_id: str
:return: passing match log for a player in a given season
:rtype: list

.. py:function:: .fbref.fb_player_match_logs_passing_types(pageSoup=None, season_end: str = None, player_id: str = None) -> dict
Retrieves a players passing type match log for a given season

:param pageSoup: bs4 object of a players passing type match log page. Defaults to None.
:type pageSoup: bs4 or None
:param season_end: ending year of a season
:type season_end: str
:param player_id: unique identifier for a player
:type player_id: str
:return: passing type match log for a player in a given season
:rtype: list

.. py:function:: .fbref.fb_player_match_logs_possession(pageSoup=None, season_end: str = None, player_id: str = None) -> dict
Retrieves a players possession match log for a given season

:param pageSoup: bs4 object of a players possession match log page. Defaults to None.
:type pageSoup: bs4 or None
:param season_end: ending year of a season
:type season_end: str
:param player_id: unique identifier for a player
:type player_id: str
:return: possession match log for a player in a given season
:rtype: list

.. py:function:: .fbref.fb_player_match_logs_summary(pageSoup=None, season_end: str = None, player_id: str = None) -> dict
Retrieves a players summary match log for a given season

:param pageSoup: bs4 object of a players summary match log page. Defaults to None.
:type pageSoup: bs4 or None
:param season_end: ending year of a season
:type season_end: str
:param player_id: unique identifier for a player
:type player_id: str
:return: summary match log for a player in a given season
:rtype: list


Team functions
--------------

Expand Down
4 changes: 2 additions & 2 deletions docs/_sources/fotmob.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ Functions
:param json_file: json file of match page. Defaults to None.
:type json_file: json or None
:return: match data and json of match page (optional)
:rtype: (dict, list, list, list, list, list, list, json) or (dict, list, list, list, list, list, list)
:rtype: (dict, list, dict, list, list, list, list, list, list, json) or (dict, list, dict, list, list, list, list, list, list)

.. py:function:: .fotmob.fm_match_ids(match_date: str, ccode: str = None, name: str = None, league_id: str = None) -> list
Expand Down Expand Up @@ -244,7 +244,7 @@ Functions
- ``Accurate long balls per match``
- ``Accurate passes per match``
- ``Average possession``
- ``Big chances created``
- ``Big chances``
- ``Big chances missed``
- ``Clean sheets``
- ``Clearances per match``
Expand Down
73 changes: 55 additions & 18 deletions docs/_sources/transfermarkt.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,22 @@ Complete list of all transfermarkt functions
Player functions
----------------

.. py:function:: .transfermarkt.tm_player_data(url: str, save_html: bool = False, html_file: BeautifulSoup = None) -> tuple
.. py:function:: .transfermarkt.tm_player_data(url: str, html_file: BeautifulSoup = None, json_file_mv: json = None, json_file_transfers: json = None, save_files: bool = False) -> tuple
Extracts metadata, market value history, and transfer history for a given player

:param url: path of transfermarkt player page
:type url: str
:param save_html: whether to save html file. Defaults to False.
:type currency: bool
:param html_file: pageSoup html file. Defaults to None.
:param html_file: pageSoup html file of profile page. Defaults to None.
:type html_file: BeautifulSoup or None
:return: player metadata, historical market values, transfer history, and BeautifulSoup file of player page (optional)
:rtype: (dict, list, list, BeautifulSoup) or (dict, list, list)
:param json_file_mv: json file of player market value history. Defaults to None.
:type json_file_mv: json or None
:param json_file_transfers: json file of player transfer history. Defaults to None.
:type json_file_transfers: json or None
:param save_files: whether to save html and json files. Defaults to False.
:type save_files: bool
:return: player metadata, historical market values, transfer history, BeautifulSoup file of player page (optional), json file of market value history (optional), and json file of transfer history (optional)
:rtype: (dict, list, list, BeautifulSoup, json, json) or (dict, list, list)

.. py:function:: .transfermarkt.tm_player_injury(pageSoup) -> list
Expand All @@ -28,14 +32,14 @@ Player functions
:return: player injuries
:rtype: list

.. py:function:: .transfermarkt.tm_player_market_value(pageSoup=None, url: str = None) -> list
.. py:function:: .transfermarkt.tm_player_market_value(json_file: json = None, player_id: str = None) -> list
Extracts date, team, and market value from highchart

:param pageSoup: bs4 object of player page referenced in url. Defaults to None.
:type pageSoup: bs4
:param url: path of transfermarkt player page. Defaults to None.
:type url: str
:param json_file: json file of player market value history. Defaults to None.
:type json_file: json or None
:param player_id: transfermarkt player id. Defaults to None.
:type player_id: str or None
:return: market value of player by date
:rtype: list

Expand All @@ -44,20 +48,20 @@ Player functions
Extracts general player information (biographical, club, contract, market value, and miscellaneous)

:param pageSoup: bs4 object of player page referenced in url. Defaults to None.
:type pageSoup: bs4
:type pageSoup: bs4 or None
:param url: path of transfermarkt player page. Defaults to None.
:type url: str
:type url: str or None
:return: player metadata
:rtype: dict

.. py:function:: .transfermarkt.tm_player_transfers(pageSoup=None, url: str = None) -> list:
.. py:function:: .transfermarkt.tm_player_transfers(json_file: json = None, player_id: str = None) -> list
Extracts player transfer information

:param pageSoup: bs4 object of player page referenced in url. Defaults to None.
:type pageSoup: bs4
:param url: path of transfermarkt player page. Defaults to None.
:type url: str
:param json_file: json file of player transfer history. Defaults to None.
:type json_file: json or None
:param player_id: transfermarkt player id. Defaults to None.
:type player_id: str or None
:return: player transfers
:rtype: list

Expand Down Expand Up @@ -104,6 +108,39 @@ Team functions
:type transfermarkt_name: bool
:return: squad players
:rtype: list

.. py:function:: .transfermarkt.tm_team_staff(club: str = None, team_id: int = None, pageSoup = None, url: str = None) -> list
Extracts team staff information

:param club: club name
:type club: str
:param team_id: transfermarkt team id. Defaults to None.
:type team_id: int
:param pageSoup: bs4 object of staff page for team referenced in url. Defaults to None.
:type pageSoup: bs4
:param url: path of transfermarkt staff page. Defaults to None.
:type url: str
:return: team staff
:rtype: list

.. py:function:: .transfermarkt.tm_team_staff_history(club: str = None, team_id: int = None, pageSoup = None, url: str = None, role: str = None) -> list
Extracts historical team staff information for a given role

:param club: club name
:type club: str
:param team_id: transfermarkt team id. Defaults to None.
:type team_id: int
:param pageSoup: bs4 object of staff page for team referenced in url. Defaults to None.
:type pageSoup: bs4
:param url: path of transfermarkt staff page. Defaults to None.
:type url: str
:param role: role of staff member. Defaults to None.
:type role: str
:return: team role staff history
:rtype: list


Helper functions
----------------
Expand Down
Loading

0 comments on commit 4500623

Please sign in to comment.