Extract league rankings from the DBB (Deutscher Basketball Bund e.V.) website.
Project description
Extract league rankings from the DBB (Deutscher Basketball Bund e.V.) website.
This library has been extracted from the web application behind the website of the BTB Royals Oldenburg (a basketball team from Oldenburg, Germany) where it has proven itself for many, many years.
Requirements
Installation
Install this package via pip:
$ pip install dbb-ranking-parser
Because of the dependency on lxml, this will also require the header files for the targeted Python version as well as those for libxml2 and libxslt.
On Debian Linux, one should be able to install these from the distribution’s repositories (as the ‘root’ user):
# aptitude update
# aptitude install python3.4-dev libxml2-dev libxslt1-dev
Apart from that (for example, if those packages are not yet installed) it might be easier to install Debian’s pre-built binary packages for lxml instead:
# aptitude update
# aptitude install python-lxml
Usage
To fetch and parse a league ranking, the appropriate URL is required.
It can be obtained on the DBB website. On every league’s ranking page there should be a link to a (non-“XL”) HTML print version.
Its target URL should look like this (assuming the league’s ID is 12345): http://www.basketball-bund.net/public/tabelle.jsp?print=1&viewDescKey=sport.dbb.views.TabellePublicView/index.jsp_&liga_id=12345
from dbbrankingparser import load_ranking
URL = '<see example above>'
ranking = load_ranking(URL)
top_team = ranking[0]
print('Top team:', top_team['name'])
- Copyright:
2006-2016 Jochen Kupperschmidt
- Date:
05-Mar-2016
- License:
MIT, see LICENSE for details.
- Version:
0.1
- Website:
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for dbb_ranking_parser-0.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d2dd917505bd8f9f8c0bac29549d0fb5e100f50d39b74ed938af09f75a1c7b0b |
|
MD5 | 78943d8024c5430fe9ae133d7b878487 |
|
BLAKE2b-256 | 14892a76edd3a90117f8631cfec4134934974260ae5c51147c4b634def917e65 |