{ "info": { "author": "Jochen Kupperschmidt", "author_email": "homework@nwsnet.de", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Other Audience", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Topic :: Internet :: WWW/HTTP :: Dynamic Content", "Topic :: Other/Nonlisted Topic" ], "description": "DBB Ranking Parser\n==================\n\nExtract league rankings from the DBB_ (Deutscher Basketball Bund e.V.)\nwebsite.\n\nThis library has been extracted from the web application behind the\nwebsite of the `BTB Royals Oldenburg`_ (a basketball team from\nOldenburg, Germany) where it has proven itself for many, many years.\n\n\nRequirements\n------------\n\n- Python_ 3.4+\n- lxml_\n\n\nInstallation\n------------\n\nInstall this package via pip_:\n\n.. code:: sh\n\n $ pip install dbb-ranking-parser\n\nBecause of the dependency on lxml_, this will also require the header\nfiles for the targeted Python_ version as well as those for libxml2_ and\nlibxslt_.\n\nOn `Debian Linux`_, one should be able to install these from the\ndistribution's repositories (as the 'root' user):\n\n.. code:: sh\n\n # aptitude update\n # aptitude install python3.4-dev libxml2-dev libxslt1-dev\n\nApart from that (for example, if those packages are not yet installed)\nit might be easier to install Debian's pre-built binary packages for\nlxml_ instead:\n\n.. code:: sh\n\n # aptitude update\n # aptitude install python-lxml\n\n\nUsage\n-----\n\nTo fetch and parse a league ranking, the appropriate URL is required.\n\nIt can be obtained on the DBB_ website. On every league's ranking page\nthere should be a link to a (non-\"XL\") HTML print version.\n\nIts target URL should look like this (assuming the league's ID is\n12345):\n``http://www.basketball-bund.net/public/tabelle.jsp?print=1&viewDescKey=sport.dbb.views.TabellePublicView/index.jsp_&liga_id=12345``\n\nThe league ID has to be identified manually in any of the URLs specific\nfor that league (ranking, schedule, stats).\n\nFor convenience, specifying only the league ID is sufficient; the URL\nwill be assembled automatically. (Obviously, this might break when the\nURL structure changes on the DBB website.)\n\n\nProgrammatically\n~~~~~~~~~~~~~~~~\n\n.. code:: python\n\n from dbbrankingparser import load_ranking_for_league\n\n\n league_id = 12345\n\n ranking = list(load_ranking_for_league(league_id))\n\n top_team = ranking[0]\n print('Top team:', top_team['name'])\n\nThe URL can be specified explicitly, too:\n\n.. code:: python\n\n from dbbrankingparser import load_ranking_from_url\n\n\n URL = ''\n\n ranking = list(load_ranking_from_url(URL))\n\nNote that a call to a ``load_ranking_*`` method returns a generator. To\nkeep its elements around, and also to access them by index, they can be\nfed into a list (as shown above).\n\n\nOn the Command Line\n~~~~~~~~~~~~~~~~~~~\n\nThe package includes a command line script to retrieve a league's\nrankings non-programmatically, as JSON. It requires a league ID as its\nsole argument:\n\n.. code:: sh\n\n $ dbb-ranking 12345\n [{\"name\": \"Team ACME\", \"rank\": 1, \u2026}]\n\n\nVia HTTP\n~~~~~~~~\n\nAlso included is an HTTP wrapper around the parser.\n\nTo spin up the server:\n\n.. code:: sh\n\n $ dbb-ranking-server\n Listening for HTTP requests on localhost:8080 ...\n\nSince this is mostly meant to be used inside a Docker_ container, host\nand port are not (easily) configurable at this point.\n\nThe server will attempt to look up a ranking for requests with an URL\npart of the form ``/``:\n\n.. code:: sh\n\n $ curl http://localhost:8080/12345\n [{\"name\": \"Team ACME\", \"rank\": 1, \u2026}]\n\n\nDocker\n------\n\nThe command line and HTTP server scripts can also be run in a Docker_\ncontainer each.\n\nBuilding the respective Docker_ images requires:\n\n- Docker_ being installed\n- a source copy of the `dbb-ranking-parser` package\n\nIn the package path (as the 'root' user):\n\n- to build an image for the command line script:\n\n .. code:: sh\n\n # docker build -t dbb-ranking-parser-cli ./docker/cli\n\n- to build an HTTP server image:\n\n .. code:: sh\n\n # docker build -t dbb-ranking-parser-server ./docker/httpserver\n\nEach of these commands should build a Docker_ image based upon `Alpine\nLinux`_ and which includes Python_ 3, lxml_ and the DBB Ranking Parser\nitself. It should be roughly 75 MB in size.\n\nRunning the command line script in a container requires the league ID as\nthe sole argument:\n\n.. code:: sh\n\n # docker run --rm dbb-ranking-parser-cli 12345\n [{\"name\": \"Team ACME\", \"rank\": 1, \u2026}]\n\nTo spin up the HTTP server on port 8080:\n\n.. code:: sh\n\n # docker run -p 8080:8080 --rm dbb-ranking-parser-server\n\nThe ``--rm`` option causes a container (but not the image) to be removed\nafter it exits.\n\n\n.. _DBB: http://www.basketball-bund.net/\n.. _BTB Royals Oldenburg: https://www.btbroyals.de/\n.. _Python: https://www.python.org/\n.. _pip: http://www.pip-installer.org/\n.. _lxml: http://lxml.de/\n.. _libxml2: http://xmlsoft.org/XSLT/\n.. _libxslt: http://xmlsoft.org/XSLT/\n.. _Debian Linux: https://www.debian.org/\n.. _Docker: https://www.docker.com/\n.. _Alpine Linux: http://alpinelinux.org/\n\n\n:Copyright: 2006-2016 Jochen Kupperschmidt\n:Date: 10-Mar-2016\n:License: MIT, see LICENSE for details.\n:Version: 0.3.1\n:Website: http://homework.nwsnet.de/releases/4a51/#dbb-ranking-parser", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://homework.nwsnet.de/releases/4a51/#dbb-ranking-parser", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "dbb-ranking-parser", "package_url": "https://pypi.org/project/dbb-ranking-parser/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/dbb-ranking-parser/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://homework.nwsnet.de/releases/4a51/#dbb-ranking-parser" }, "release_url": "https://pypi.org/project/dbb-ranking-parser/0.3.1/", "requires_dist": null, "requires_python": null, "summary": "Extract league rankings from the DBB (Deutscher Basketball Bund e.V.) website.", "version": "0.3.1" }, "last_serial": 1998521, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "78943d8024c5430fe9ae133d7b878487", "sha256": "d2dd917505bd8f9f8c0bac29549d0fb5e100f50d39b74ed938af09f75a1c7b0b" }, "downloads": -1, "filename": "dbb_ranking_parser-0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "78943d8024c5430fe9ae133d7b878487", "packagetype": "bdist_wheel", "python_version": "3.4", "requires_python": null, "size": 5725, "upload_time": "2016-03-05T22:28:16", "url": "https://files.pythonhosted.org/packages/14/89/2a76edd3a90117f8631cfec4134934974260ae5c51147c4b634def917e65/dbb_ranking_parser-0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7ad4973f36150d1805cc0c43b31c7c6f", "sha256": "55e4456f4a624eba42a2dd886b96867729388dcbb7666e641bca864164ce322f" }, "downloads": -1, "filename": "dbb-ranking-parser-0.1.tar.gz", "has_sig": false, "md5_digest": "7ad4973f36150d1805cc0c43b31c7c6f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6327, "upload_time": "2016-03-05T22:27:54", "url": "https://files.pythonhosted.org/packages/ca/3a/7f5d91cd3d73ca58823a0adb938cd00d9cb0ebb3c7c5d52d5e45d3daa9d4/dbb-ranking-parser-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "7ff80eeb6e53ce9ed73a828fc24158fd", "sha256": "b87a9fe9bee3bf60f368cfa2be27f03eef134934de554c9c34ef921c34fe9225" }, "downloads": -1, "filename": "dbb_ranking_parser-0.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "7ff80eeb6e53ce9ed73a828fc24158fd", "packagetype": "bdist_wheel", "python_version": "3.4", "requires_python": null, "size": 9581, "upload_time": "2016-03-06T04:41:25", "url": "https://files.pythonhosted.org/packages/34/6e/155f86efbcaa453289ae12d7b3ca799a5bba033a9e2da352235a4408effc/dbb_ranking_parser-0.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "46eb6f2f67288a21744e596c5b8403db", "sha256": "86fc9b31910926de6392765bceb34cb99e664b795ee96ffa2eb030e9cc2d68ba" }, "downloads": -1, "filename": "dbb-ranking-parser-0.2.tar.gz", "has_sig": false, "md5_digest": "46eb6f2f67288a21744e596c5b8403db", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10126, "upload_time": "2016-03-06T04:39:03", "url": "https://files.pythonhosted.org/packages/73/29/9315826919b2ec90ea1d44c84bf62f7713bb1c3d530b262e2baa2209b97b/dbb-ranking-parser-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "81cae2a13bdc53a732871ae4100429de", "sha256": "fab8e2f160498508d252d6706ee3b3d539fb81d823dfe03307511e42e89019f1" }, "downloads": -1, "filename": "dbb_ranking_parser-0.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "81cae2a13bdc53a732871ae4100429de", "packagetype": "bdist_wheel", "python_version": "3.4", "requires_python": null, "size": 11722, "upload_time": "2016-03-08T03:25:32", "url": "https://files.pythonhosted.org/packages/d5/6a/b99cbc4bd36dc5e04070cb7c3546ecb8dfff1d24885da73272c58b314ef8/dbb_ranking_parser-0.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1f7c80263aed39457c677f750966d383", "sha256": "1be25b0ddeee97f66e5978539356c576ebd79c1d83ca400b5f031f540a5848f9" }, "downloads": -1, "filename": "dbb-ranking-parser-0.3.tar.gz", "has_sig": false, "md5_digest": "1f7c80263aed39457c677f750966d383", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12479, "upload_time": "2016-03-08T03:24:30", "url": "https://files.pythonhosted.org/packages/ac/23/125cff005b4873b9e1ec2d4f6233b0cf350c74a229d0bf16b285d474626b/dbb-ranking-parser-0.3.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "d28b4fac8f8f7a889c020d2ee2190e34", "sha256": "48e7dcfcc77c04ddc5df9f5080888c393be6cfc13bbac046711fa7c20a6e2667" }, "downloads": -1, "filename": "dbb_ranking_parser-0.3.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "d28b4fac8f8f7a889c020d2ee2190e34", "packagetype": "bdist_wheel", "python_version": "3.4", "requires_python": null, "size": 11935, "upload_time": "2016-03-10T02:39:41", "url": "https://files.pythonhosted.org/packages/0e/eb/5db2288212e88df0b8bf994cfd0fea9c8559e43f77ac53e0f32677f7b950/dbb_ranking_parser-0.3.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "74fc987f34334f16f13007c1fdf2b457", "sha256": "104c6536f1aab9a4d9634f0ab5bf1d254ab3f7b97d0afdc6a3eb809313c17882" }, "downloads": -1, "filename": "dbb-ranking-parser-0.3.1.tar.gz", "has_sig": false, "md5_digest": "74fc987f34334f16f13007c1fdf2b457", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12855, "upload_time": "2016-03-10T02:39:17", "url": "https://files.pythonhosted.org/packages/39/c0/485210f030e541dcdfb1b2bc624f28ac4af87ab5908ed9f7bf8f7b7ee25a/dbb-ranking-parser-0.3.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d28b4fac8f8f7a889c020d2ee2190e34", "sha256": "48e7dcfcc77c04ddc5df9f5080888c393be6cfc13bbac046711fa7c20a6e2667" }, "downloads": -1, "filename": "dbb_ranking_parser-0.3.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "d28b4fac8f8f7a889c020d2ee2190e34", "packagetype": "bdist_wheel", "python_version": "3.4", "requires_python": null, "size": 11935, "upload_time": "2016-03-10T02:39:41", "url": "https://files.pythonhosted.org/packages/0e/eb/5db2288212e88df0b8bf994cfd0fea9c8559e43f77ac53e0f32677f7b950/dbb_ranking_parser-0.3.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "74fc987f34334f16f13007c1fdf2b457", "sha256": "104c6536f1aab9a4d9634f0ab5bf1d254ab3f7b97d0afdc6a3eb809313c17882" }, "downloads": -1, "filename": "dbb-ranking-parser-0.3.1.tar.gz", "has_sig": false, "md5_digest": "74fc987f34334f16f13007c1fdf2b457", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12855, "upload_time": "2016-03-10T02:39:17", "url": "https://files.pythonhosted.org/packages/39/c0/485210f030e541dcdfb1b2bc624f28ac4af87ab5908ed9f7bf8f7b7ee25a/dbb-ranking-parser-0.3.1.tar.gz" } ] }