residuum / premier_league_table

Downloads the data from the premier league on a daily basis.

Scrapes www.premierleague.com

Barclays Premier League football news, fixtures, scores & results


This is a scraper that runs on Morph. To get started see the documentation.

This scraper downloads the current table of the English Football Premier League and stores it in a database. The data is then accessed via a JSON API for sonification with libPd.

The table is output as an array with each team being an object with the following format:

{
  pos: <integer, position 1-20>,
  team: <string, team name>,
  pts: <integer, points>,
  gf: <integer, goals for>,
  ga: <integer, goals against>,
  gd: <integer, goal difference>
}

Contributors residuum

Last run completed successfully .

Console output of last run

Injecting configuration and compiling...  -----> Python app detected  ! The latest version of Python 2 is python-2.7.14 (you are using python-2.7.9, which is unsupported).  ! We recommend upgrading by specifying the latest version (python-2.7.14).  Learn More: https://devcenter.heroku.com/articles/python-runtimes -----> Installing python-2.7.9 -----> Installing pip -----> Installing requirements with pip  Obtaining scraperwiki from git+http://github.com/openaustralia/scraperwiki-python.git@morph_defaults#egg=scraperwiki (from -r /tmp/build/requirements.txt (line 6))  Cloning http://github.com/openaustralia/scraperwiki-python.git (to revision morph_defaults) to /app/.heroku/src/scraperwiki  Collecting lxml==3.4.4 (from -r /tmp/build/requirements.txt (line 8))  Downloading https://files.pythonhosted.org/packages/63/c7/4f2a2a4ad6c6fa99b14be6b3c1cece9142e2d915aa7c43c908677afc8fa4/lxml-3.4.4.tar.gz (3.5MB)  Collecting cssselect==0.9.1 (from -r /tmp/build/requirements.txt (line 9))  Downloading https://files.pythonhosted.org/packages/aa/e5/9ee1460d485b94a6d55732eb7ad5b6c084caf73dd6f9cb0bb7d2a78fafe8/cssselect-0.9.1.tar.gz  Collecting requests (from -r /tmp/build/requirements.txt (line 10))  Downloading https://files.pythonhosted.org/packages/49/df/50aa1999ab9bde74656c2919d9c0c085fd2b3775fd3eca826012bef76d8c/requests-2.18.4-py2.py3-none-any.whl (88kB)  Collecting dumptruck>=0.1.2 (from scraperwiki->-r /tmp/build/requirements.txt (line 6))  Downloading https://files.pythonhosted.org/packages/15/27/3330a343de80d6849545b6c7723f8c9a08b4b104de964ac366e7e6b318df/dumptruck-0.1.6.tar.gz  Collecting idna<2.7,>=2.5 (from requests->-r /tmp/build/requirements.txt (line 10))  Downloading https://files.pythonhosted.org/packages/27/cc/6dd9a3869f15c2edfab863b992838277279ce92663d334df9ecf5106f5c6/idna-2.6-py2.py3-none-any.whl (56kB)  Collecting urllib3<1.23,>=1.21.1 (from requests->-r /tmp/build/requirements.txt (line 10))  Downloading https://files.pythonhosted.org/packages/63/cb/6965947c13a94236f6d4b8223e21beb4d576dc72e8130bd7880f600839b8/urllib3-1.22-py2.py3-none-any.whl (132kB)  Collecting certifi>=2017.4.17 (from requests->-r /tmp/build/requirements.txt (line 10))  Downloading https://files.pythonhosted.org/packages/7c/e6/92ad559b7192d846975fc916b65f667c7b8c3a32bea7372340bfe9a15fa5/certifi-2018.4.16-py2.py3-none-any.whl (150kB)  Collecting chardet<3.1.0,>=3.0.2 (from requests->-r /tmp/build/requirements.txt (line 10))  Downloading https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl (133kB)  Installing collected packages: dumptruck, idna, urllib3, certifi, chardet, requests, scraperwiki, lxml, cssselect  Running setup.py install for dumptruck: started  Running setup.py install for dumptruck: finished with status 'done'  Running setup.py develop for scraperwiki  Running setup.py install for lxml: started  Running setup.py install for lxml: still running...  Running setup.py install for lxml: finished with status 'done'  Running setup.py install for cssselect: started  Running setup.py install for cssselect: finished with status 'done'  Successfully installed certifi-2018.4.16 chardet-3.0.4 cssselect-0.9.1 dumptruck-0.1.6 idna-2.6 lxml-3.4.4 requests-2.18.4 scraperwiki urllib3-1.22   -----> Discovering process types  Procfile declares types -> scraper Injecting scraper and running...

Data

Downloaded 494 times by residuum MikeRalphson

To download data sign in with GitHub

Download table (as CSV) Download SQLite database (3 KB) Use the API

rows 10 / 20

pts pos gd ga gf team
87
1
68
25
93
Manchester City
74
2
39
26
65
Manchester United
70
3
43
35
78
Liverpool
68
4
35
31
66
Tottenham Hotspur
63
5
25
34
59
Chelsea
54
6
17
45
62
Arsenal
52
7
3
31
34
Burnley
44
8
2
47
49
Leicester City
42
9
-15
54
39
Everton
41
10
-7
42
35
Newcastle United

Statistics

Average successful run time: 2 minutes

Total run time: about 1 month

Total cpu time used: 8 minutes

Total disk space used: 27.4 KB

History

  • Auto ran revision 43e89d05 and completed successfully .
    20 records updated in the database
    2 pages scraped
  • Auto ran revision 43e89d05 and completed successfully .
    20 records updated in the database
  • Auto ran revision 43e89d05 and completed successfully .
    20 records updated in the database
    2 pages scraped
  • Auto ran revision 43e89d05 and completed successfully .
    20 records updated in the database
  • Auto ran revision 43e89d05 and completed successfully .
    20 records updated in the database
  • ...
  • Created on morph.io

Show complete history

Scraper code

Python

premier_league_table / scraper.py