{"id":23577098,"url":"https://github.com/jacaranda-analytics/fraser_gehrig","last_synced_at":"2025-09-10T23:38:28.971Z","repository":{"id":64257579,"uuid":"574453848","full_name":"jacaranda-analytics/fraser_gehrig","owner":"jacaranda-analytics","description":"Scrape AFL data from afltables.com. Get around Fraser Gehrig. ","archived":false,"fork":false,"pushed_at":"2024-08-20T11:01:06.000Z","size":46,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-04T04:04:31.551Z","etag":null,"topics":["afl","data-science","python","scraping"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/fraser-gehrig/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jacaranda-analytics.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-12-05T10:52:39.000Z","updated_at":"2024-08-21T02:35:02.000Z","dependencies_parsed_at":"2023-01-15T07:00:40.385Z","dependency_job_id":null,"html_url":"https://github.com/jacaranda-analytics/fraser_gehrig","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/jacaranda-analytics/fraser_gehrig","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacaranda-analytics%2Ffraser_gehrig","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacaranda-analytics%2Ffraser_gehrig/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacaranda-analytics%2Ffraser_gehrig/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacaranda-analytics%2Ffraser_gehrig/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jacaranda-analytics","download_url":"https://codeload.github.com/jacaranda-analytics/fraser_gehrig/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacaranda-analytics%2Ffraser_gehrig/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272758377,"owners_count":24988238,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-29T02:00:10.610Z","response_time":87,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["afl","data-science","python","scraping"],"created_at":"2024-12-26T22:19:33.154Z","updated_at":"2025-08-29T20:31:24.177Z","avatar_url":"https://github.com/jacaranda-analytics.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Fraser Gehrig \n==================\n\n[![PyPI version](https://badge.fury.io/py/fraser_gehrig.svg)](https://badge.fury.io/py/fraser_gehrig) [![GitHub version](https://badge.fury.io/gh/jacaranda-analytics%2Ffraser-gehrig.svg)](https://badge.fury.io/gh/jacaranda-analytics%2Ffraser-gehrig)[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n`master` ![master ci status](https://github.com/jacaranda-analytics/fraser_gehrig/actions/workflows/python-package.yml/badge.svg?branch=main)\n\n\u003c!-- markdown-toc start - Don't edit this section. Run M-x markdown-toc-refresh-toc --\u003e\n**Table of Contents**\n\n- [Fraser Gehrig ](#fraser-gehrig)\n- [Description](#description)\n- [Kaggle](#kaggle)\n- [Installation](#installation)\n    - [GitHub](#github)\n    - [Pip](#pip)\n- [Examples](#examples)\n    - [Get player stats for a single year](#get--player-stats-for-a-single-year)\n    - [Get game stats For a single year](#get-game-stats-for-a-single-year)\n    - [Get game by game results for a single year](#get--game-by-game-results-for-a-single-year)\n- [License](#license)\n\n\u003c!-- markdown-toc end --\u003e\n\n![Fraser Gehrig](https://i.ytimg.com/vi/fvE6R92tTG0/sddefault.jpg)\n\n# Description \n\nThis is a small webscraper package to scrap AFL player and game statistics data from [AFL Tables](https://afltables.com/afl/afl_index.html). \n\nThis package is named after the famous St Kilda forward Fraser Gehrig because, why not? \n\n\n# Kaggle \n\nA kaggle dataset of the entire set of scraped table data, using this package, is available [here](https://www.kaggle.com/datasets/gabrieldennis/afl-player-and-game-data-and-statistics18972022). \nThe script which was used to scrape the set of tables and package up the dataset for kaggle is located [here](examples/kaggle_data.py). \n\n\n- A Kaggle notebook which uses this data to predict the 2021 Brownlow medal counts can be seen [here](https://www.kaggle.com/gabrieldennis/2021-brownlow-prediction-mlp)\n\n# Installation \n\nCurrently, there are various ways this package can be installed. \nThese include \n\n- GitHub \n- pip\n\n## GitHub \n\nTo install from GitHub there are two options, \nthe first option is to clone the repository and do a local installation from the cloned directory. \n\n```sh\ngit clone git@github.com:jacaranda-analytics/fraser_gehrig.git\ncd fraser_gehrig/ \u0026\u0026 pip install . \n```\n\nThe second option is to install from GitHub without first cloning the repository, \nto install the latest master branch, run the command. \n\n```sh\npip install https://github.com/jacaranda-analytics/fraser_gehrig/archive/master.zip\n```\n\n## Pypi \n\nTo install through Pypi, simply run \n\n```python \npip install fraser-gehrig\n```\n\n\n# Examples \n\nThe following section shows some example usages for this tool \n\n\n```python \n\n\u003e\u003e\u003e\u003e import  fraser_gehrig.fraser_gehrig as fg \n\n```\n\n## Get player stats for a single year \n\n\n```python \n\n\u003e\u003e\u003e fg.get_player_stats(year = 2020)\nLoading Data:\n                  jumper games_played kicks marks\nCrouch, Matt           5           16   162    44\nLaird, Rory           29           17   186    46\nSmith, Brodie         33           16   203    58\nKeays, Ben            28           16   147    47\nCrouch, Brad           2           12   136    20\n...                  ...          ...   ...   ...\nSchache, Josh         13            2     8     3\nPorter, Callum        28            1     4    NA\nTrengove, Jackson      8            1     2     1\nDickson, Tory         29            1    NA    NA\nYoung, Lewis           2            1     3     3\n\n[650 rows x 27 columns]\n\n```\n\n## Get game stats For a single year \n\n\n```python \n \n\u003e\u003e\u003e fg.get_game_by_game_stats(year = 2020)\n.\n.\n.\n         index        player       team  round opponents       stat value\n0            0  Atkins, Rory   adelaide      0        SY  disposals    14\n1            1  Atkins, Rory   adelaide      1        PA  disposals    10\n2            2  Atkins, Rory   adelaide      2        GC  disposals     3\n3            3  Atkins, Rory   adelaide      3        BL  disposals    NA\n4            4  Atkins, Rory   adelaide      4        FR  disposals    NA\n...        ...           ...        ...    ...       ...        ...   ...\n267600  267600  Young, Lewis  bullldogs     13        GE   %_played    NA\n267601  267601  Young, Lewis  bullldogs     14        WC   %_played    NA\n267602  267602  Young, Lewis  bullldogs     15        HW   %_played    NA\n267603  267603  Young, Lewis  bullldogs     16        FR   %_played    NA\n267604  267604  Young, Lewis  bullldogs     17        SK   %_played    NA\n\n[267605 rows x 7 columns]\n\n\n```\n\n## Get game by game results for a single year\n\n\n```python \n\u003e\u003e\u003e fg.get_game_by_game_results(year = 2020)\n            team   round       opponent  kicks  ... marks_inside_50 one_percenters bounces goal_assist\n0           Adelaide   R1          Sydney  142-200  ...             6-8          38-47     7-0         7-7\n1           Adelaide   R2   Port Adelaide  138-226  ...            4-13          41-45      NA         5-9\n2           Adelaide   R3      Gold Coast  145-196  ...            2-10          33-36     2-4         2-7\n3           Adelaide   R4  Brisbane Lions  162-199  ...            5-19          34-42     1-3         5-9\n4           Adelaide   R5       Fremantle  170-197  ...            6-15          32-29     2-6         2-7\n..               ...  ...             ...      ...  ...             ...            ...     ...         ...\n13  Western Bulldogs  R14         Geelong  146-183  ...            10-7          49-40     1-5         7-7\n14  Western Bulldogs  R16      West Coast  157-175  ...            8-10          38-35     1-4         3-7\n15  Western Bulldogs  R17        Hawthorn  192-140  ...             9-5          61-50     0-1         9-4\n16  Western Bulldogs  R18       Fremantle  162-172  ...            12-8          55-31     6-3         8-5\n17  Western Bulldogs   EF        St Kilda  175-184  ...            9-12          48-44     3-6         4-7\n\n[324 rows x 25 columns]\n```\n\n\n# License \n\n- [MIT](LICENSE.md)\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacaranda-analytics%2Ffraser_gehrig","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjacaranda-analytics%2Ffraser_gehrig","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacaranda-analytics%2Ffraser_gehrig/lists"}