The AFL Tables Scraper is a Python package and command-line executable that downloads Australian Football League (AFL) match data from the fantastic database AFL Tables, and outputs it in a structured, machine-readable form.
Full documentation available on Github Pages
Note that this module requires python 3.5 and above
Install using:
pip install afl_tablesThe AFL Tables module can be used to scrape matches as follows:
from afl_tables import MatchScraper
# Make a scraper for a particular year (2015)
rounds = MatchScraper.scrape(2015)See the docs on Round for more information on how to use this object
The AFL Tables module also creates a command-line script called afltables, which can be used to scrape data outside
of a python script. Usage is as follows
usage: Scrapes the AFL Tables website and returns JSON data representing the matches
[-h] year
positional arguments:
year The year to scrape
optional arguments:
-h, --help show this help message and exit
- Fix for missing fields in the attendees/date/venue part of the table, for example in 2020
- Added some tests for the package
- Initial release