{ "info": { "author": "Patrick McFarlane & Avyay Varadarajan", "author_email": "patmcfarla@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "[![Downloads](https://pepy.tech/badge/py-ball)](https://pepy.tech/project/py-ball)\n\n# py_ball\nPython API wrapper for stats.nba.com with a focus on NBA and WNBA applications\n\n## Introduction\n\nThe motivation for this stems from [nba_py](https://github.com/seemethere/nba_py) by [seemethere](https://github.com/seemethere) and [nbastatsR](https://github.com/abresler/nbastatR) by [abresler](https://github.com/abresler). The work towards a Python API wrapper in `nba_py` is a great start, but the documentation of the [stats.nba.com](https://stats.nba.com) API is lacking. `nbastatsR` is an extremely valuable resource for the R community, and this work hopes to extend the breadth and depth of that package. In my research, I have also come across the recent effort of [nba_api](https://github.com/swar/nba_api) by [swar](https://github.com/swar). This looks similar to `nba_py` and I am hoping to collaborate.\n\n## Goals\n\nIf successful, `py_ball` should accomplish the following:\n- By working with the community, improve the quality of documentation for [stats.nba.com](https://stats.nba.com).\n- Further enable the dissemination of basketball statistics to increase the understanding of the sport and encourage the practice of basketball analytics.\n- Produce introductory analyses leveraging NBA and WNBA data to reduce the barrier of entry to basketball analytics through demonstration.\n- Focus on the WNBA in an effort to stress inclusivity and contribute to women's basketball analytics.\n\n## Documentation\n\nWhile `nba_api` improves greatly upon the documentation of the [stats.nba.com](https://stats.nba.com) API in `nba_py`, `py_ball` strives to take documentation further through the following:\n- Fully documented code, including function, class, and script docstrings.\n- Extend endpoint and parameter documentation to include feature definitions.\n\n### [Current Documentation](https://github.com/basketballrelativity/py_ball/wiki)\n\nClasses:\n\nThe functionality of the classes within the package are documented in both the docstrings and [this site](https://basketballrelativity.github.io/py_ball/_build/html/index.html). The endpoints, parameters, and tables are documented in the Wiki (linked below):\n\n- [BoxScore](https://github.com/basketballrelativity/py_ball/wiki/BoxScore)\n- [Draft](https://github.com/basketballrelativity/py_ball/wiki/Draft)\n- [Image](https://github.com/basketballrelativity/py_ball/wiki/Image)\n- [LeaderBoard](https://github.com/basketballrelativity/py_ball/wiki/LeaderBoard)\n- [League](https://github.com/basketballrelativity/py_ball/wiki/League)\n- [LeagueDash](https://github.com/basketballrelativity/py_ball/wiki/LeagueDash)\n- [PlayByPlay](https://github.com/basketballrelativity/py_ball/wiki/PlayByPlay)\n- [Player](https://github.com/basketballrelativity/py_ball/wiki/Player)\n- [Salaries](https://github.com/basketballrelativity/py_ball/wiki/Salaries) (using [Hoopshype](https://hoopshype.com/))\n- [ScoreBoard](https://github.com/basketballrelativity/py_ball/wiki/ScoreBoard)\n- [Shots](https://github.com/basketballrelativity/py_ball/wiki/Shots)\n- [Team](https://github.com/basketballrelativity/py_ball/wiki/Team)\n- [WinProbability](https://github.com/basketballrelativity/py_ball/wiki/WinProbability)\n\n## Development\n\n1. ~~Initially map [stats.nba.com](https://stats.nba.com) API and fully document code.~~\n2. ~~Refactor code to generate a more consistent structure across classes.~~\n3. ~~Document endpoints and parameters with definitions.~~ (See Wiki [here](https://github.com/basketballrelativity/py_ball/wiki))\n4. Research other basketball-related APIs to map.\n5. ~~Write unit tests for the package.~~\n6. ~~Begin introductory basketball analytics analyses.~~\n - ~~Franchise History~~ ([here!](https://github.com/basketballrelativity/franchise_history))\n - ~~Draft Combine Player Sheet~~ ([here!](https://github.com/basketballrelativity/draft_combine))\n - ~~Live NBA/WNBA scoreboard~~ ([here!](https://github.com/basketballrelativity/scoreboard))\n - ~~Shot Probability Model~~ ([here!](https://github.com/basketballrelativity/shot_probability))\n - ~~Location Data Exploration~~ ([here!](https://github.com/basketballrelativity/location_data))\n - ~~Assist Networks~~ ([here!](https://github.com/basketballrelativity/assist_networks))\n - ~Win Probability Model~ ([here!](https://github.com/basketballrelativity/py_ball/wiki/WinProbability))\n\n## Installation\n\nThe package is built for Python 3 and leverages the packages in the `requirements.txt` file. `py_ball` can be installed via pip (more info [here](https://pypi.org/project/py-ball/)):\n```\npip install py_ball\n```\n\n## Usage\n\nThe [stats.nba.com](https://stats.nba.com) API requires a request header for all API calls. A good discussion on this, including steps to obtain a proper request header, can be found [here](https://stackoverflow.com/questions/46781563/how-to-obtain-a-json-response-from-the-stats-nba-com-api). With a request header in `HEADER`, the example below demonstrates usage of the package to pull franchise history for the WNBA:\n\n```\nfrom py_ball import league, image\n\nleague_id = '10' #WNBA\nfranchises = league.League(headers=HEADERS,\n endpoint='franchisehistory',\n league_id=league_id)\n```\n\nEach class, with the exception of the `Headshot` and `Logo` classes, has a `data` attribute. This is a dictionary containing table names as keys and a list of dictionaries of table data as values. The `Headshot` and `Logo` classes have an `image` attribute that is a PNG object.\n\n## Contact\n\nFollow along for updates or reach out on Twitter [@py_ball_](https://twitter.com/py_ball_)!", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/basketballrelativity/py_ball", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "py-ball", "package_url": "https://pypi.org/project/py-ball/", "platform": "", "project_url": "https://pypi.org/project/py-ball/", "project_urls": { "Homepage": "https://github.com/basketballrelativity/py_ball" }, "release_url": "https://pypi.org/project/py-ball/1.3/", "requires_dist": null, "requires_python": "", "summary": "Python API wrapper for stats.nba.com with a focus on NBA and WNBA applications", "version": "1.3", "yanked": false, "yanked_reason": null }, "last_serial": 12584454, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "0720d4adc83c88ab1b426daf30a60750", "sha256": "1385f931dc65f3446fe046c4018575afaeadc8ef20716772a11fc7273ef8bb98" }, "downloads": -1, "filename": "py_ball-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "0720d4adc83c88ab1b426daf30a60750", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 53477, "upload_time": "2018-12-26T18:28:56", "upload_time_iso_8601": "2018-12-26T18:28:56.035447Z", "url": "https://files.pythonhosted.org/packages/39/b6/c59863ea8c3a303f30566f6c80d72d7b6113f2805df37de42b39f84e66a7/py_ball-1.0.0-py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "11faef97c72d1a25d31164fb6182755a", "sha256": "d36a2b0ce7cf7a982c544153c2a77d0c27bb3183b5a5ce38f9959658579bf182" }, "downloads": -1, "filename": "py_ball-1.0.0.tar.gz", "has_sig": false, "md5_digest": "11faef97c72d1a25d31164fb6182755a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 36523, "upload_time": "2018-12-26T18:28:57", "upload_time_iso_8601": "2018-12-26T18:28:57.889599Z", "url": "https://files.pythonhosted.org/packages/06/86/e9f25d84dcb3202bb1b1b21b12a72c05a674f8399044f5b2111048e9274a/py_ball-1.0.0.tar.gz", "yanked": false, "yanked_reason": null } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "959a9c22aacd6647836eee498cbd0210", "sha256": "e79b18cc3c6180986ea50c625752dc77e0635a06c3c5a47ea850a6f82204b6ed" }, "downloads": -1, "filename": "py_ball-1.0.1.tar.gz", "has_sig": false, "md5_digest": "959a9c22aacd6647836eee498cbd0210", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 38912, "upload_time": "2019-05-23T02:34:33", "upload_time_iso_8601": "2019-05-23T02:34:33.650186Z", "url": "https://files.pythonhosted.org/packages/1f/9b/bdbc84d80d2cc0c0d788aa1c874e6cb6ff82564b81cb3e342a530f23b15e/py_ball-1.0.1.tar.gz", "yanked": false, "yanked_reason": null } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "f03be1c234be8e4312bc1fe7af09eb4c", "sha256": "4283e14530f22f1f970d973816d144d4541a9eb4a4986681cde813bd9e6088fc" }, "downloads": -1, "filename": "py_ball-1.0.2.tar.gz", "has_sig": false, "md5_digest": "f03be1c234be8e4312bc1fe7af09eb4c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 41480, "upload_time": "2019-06-11T02:42:16", "upload_time_iso_8601": "2019-06-11T02:42:16.526388Z", "url": "https://files.pythonhosted.org/packages/11/63/090c5e1de761cf417af93a6763430658b72a42747410fda91bca4144d192/py_ball-1.0.2.tar.gz", "yanked": false, "yanked_reason": null } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "6cec7d79c0b059f9881ca0aeff6dc8c3", "sha256": "1c20091bcbb6be0177b4df5a81487ad89b6debdeff09161def9d13dc834dccca" }, "downloads": -1, "filename": "py_ball-1.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "6cec7d79c0b059f9881ca0aeff6dc8c3", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 63022, "upload_time": "2019-07-23T22:54:43", "upload_time_iso_8601": "2019-07-23T22:54:43.507530Z", "url": "https://files.pythonhosted.org/packages/0e/65/6ea42fb0f12bddc63697cad50c9b7bdbd956d2fb066837138071359a5376/py_ball-1.0.3-py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "a21ec4f7866624062c06eceff882874e", "sha256": "73be0f384f418a7fb166d696d83974c610572c2422ccbba1f621b9f91429c718" }, "downloads": -1, "filename": "py_ball-1.0.3.tar.gz", "has_sig": false, "md5_digest": "a21ec4f7866624062c06eceff882874e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 44045, "upload_time": "2019-07-23T22:54:45", "upload_time_iso_8601": "2019-07-23T22:54:45.082231Z", "url": "https://files.pythonhosted.org/packages/0b/ee/4b3c8822ef85e19e9b41390bee9e8826f86dad82ab8ec10c765a9bfdd1b9/py_ball-1.0.3.tar.gz", "yanked": false, "yanked_reason": null } ], "1.0.4": [ { "comment_text": "", "digests": { "md5": "32bd7eeb9934bf0517c15f6f76ddc07f", "sha256": "68aa9eb82a7f6e4212f05f8688edc84ecefe5a1c534a8a76403eaaaff411ae31" }, "downloads": -1, "filename": "py_ball-1.0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "32bd7eeb9934bf0517c15f6f76ddc07f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 64883, "upload_time": "2019-10-23T02:18:44", "upload_time_iso_8601": "2019-10-23T02:18:44.213582Z", "url": "https://files.pythonhosted.org/packages/b4/98/4df55e78a9a4790671d721ea5e2da6ce219b2bde8c2ae4d0151800eee66c/py_ball-1.0.4-py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "2a0344b170fb1bb35a93f6c0dfc5cfd5", "sha256": "823476f15f675bca87c71c12d5c35ddc65a7f2cd1e617ad4a2cf4052fd0eb172" }, "downloads": -1, "filename": "py_ball-1.0.4.tar.gz", "has_sig": false, "md5_digest": "2a0344b170fb1bb35a93f6c0dfc5cfd5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 46520, "upload_time": "2019-10-23T02:18:45", "upload_time_iso_8601": "2019-10-23T02:18:45.490779Z", "url": "https://files.pythonhosted.org/packages/25/44/e223841816b3732e0c3622ff28231981478f6e261364cdb5df9380534b41/py_ball-1.0.4.tar.gz", "yanked": false, "yanked_reason": null } ], "1.0.5": [ { "comment_text": "", "digests": { "md5": "b79fec7b13b34736f86c340c3129b6ec", "sha256": "7ecc0e0b68c8e7f3745bf7cb61e1efc41feb59973344a6fa42bb9d9500d7e546" }, "downloads": -1, "filename": "py_ball-1.0.5-py3-none-any.whl", "has_sig": false, "md5_digest": "b79fec7b13b34736f86c340c3129b6ec", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 67143, "upload_time": "2020-02-23T21:11:50", "upload_time_iso_8601": "2020-02-23T21:11:50.696932Z", "url": "https://files.pythonhosted.org/packages/b6/04/57c5b1d1181b49975bd3451f35ab5f82aa69e71fba6b3caa4b1a435aa87a/py_ball-1.0.5-py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "15e566c895bfd092f190d3f7c4e3ea29", "sha256": "5d87224b33c1a25a2aef36c959090d0ffdcd41d2d7be9f3a2fe658653c541bb6" }, "downloads": -1, "filename": "py_ball-1.0.5.tar.gz", "has_sig": false, "md5_digest": "15e566c895bfd092f190d3f7c4e3ea29", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 46629, "upload_time": "2020-02-23T21:11:52", "upload_time_iso_8601": "2020-02-23T21:11:52.232071Z", "url": "https://files.pythonhosted.org/packages/bf/99/a56e1bc6b15a9f4dce448281bfcfdd9bba1497285d504db9a60604989014/py_ball-1.0.5.tar.gz", "yanked": false, "yanked_reason": null } ], "1.1": [ { "comment_text": "", "digests": { "md5": "650b36bd2afd1b86f150ab8f55cacc24", "sha256": "5f0ce0137e1a5a925a50c54ea3d9bd75c37365f59a798e1878e0c693cd1bc1c3" }, "downloads": -1, "filename": "py_ball-1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "650b36bd2afd1b86f150ab8f55cacc24", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 100812, "upload_time": "2020-07-07T23:51:34", "upload_time_iso_8601": "2020-07-07T23:51:34.413856Z", "url": "https://files.pythonhosted.org/packages/54/f9/3bde2f211f4a4ef01ee48645571e2f829421753b7175da1ddf26bcf0b91f/py_ball-1.1-py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "66927e323a8e88af00ee282d21b8de22", "sha256": "a88d55eeaf205f7da45f3367152e475fedda64cf1e3f4d8cc7943e323db03ebb" }, "downloads": -1, "filename": "py_ball-1.1.tar.gz", "has_sig": false, "md5_digest": "66927e323a8e88af00ee282d21b8de22", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 84884, "upload_time": "2020-07-07T23:51:38", "upload_time_iso_8601": "2020-07-07T23:51:38.777125Z", "url": "https://files.pythonhosted.org/packages/17/78/8cd6e51ece2158971e39f4c9d7d4ad8e4fc1d6ae07e6b6531c1f9d11160a/py_ball-1.1.tar.gz", "yanked": false, "yanked_reason": null } ], "1.2": [ { "comment_text": "", "digests": { "md5": "a35ab3bf7c5d385f3dad87ea2ae18913", "sha256": "46c90ed7eb90d3748c7775cf92fe065c11026a8fa7071b40fba257a0c92164ba" }, "downloads": -1, "filename": "py_ball-1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "a35ab3bf7c5d385f3dad87ea2ae18913", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 100893, "upload_time": "2021-01-23T03:14:24", "upload_time_iso_8601": "2021-01-23T03:14:24.191417Z", "url": "https://files.pythonhosted.org/packages/88/45/83a4d97d0738e20fc6b094af5b19da82aa173287f3970fb1228d8aa4820c/py_ball-1.2-py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "bcd2f75ed714c84154513c8b03270a38", "sha256": "c57afd0df028019083cf1c17067b63be864de077f356f3d3771256e81795a380" }, "downloads": -1, "filename": "py_ball-1.2.tar.gz", "has_sig": false, "md5_digest": "bcd2f75ed714c84154513c8b03270a38", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 84981, "upload_time": "2021-01-23T03:14:25", "upload_time_iso_8601": "2021-01-23T03:14:25.707118Z", "url": "https://files.pythonhosted.org/packages/58/9a/bb1433bde38683eac303c5032a60f0a30e29ca589da338dd2109834362a1/py_ball-1.2.tar.gz", "yanked": false, "yanked_reason": null } ], "1.3": [ { "comment_text": "", "digests": { "md5": "8079b5274dbe651a0ffc582f2029efdc", "sha256": "a863eba81ac877a4307acac50a40c27595ff733e7986cadf7398be4bd374c5c8" }, "downloads": -1, "filename": "py_ball-1.3.tar.gz", "has_sig": false, "md5_digest": "8079b5274dbe651a0ffc582f2029efdc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 85286, "upload_time": "2022-01-15T19:36:12", "upload_time_iso_8601": "2022-01-15T19:36:12.555707Z", "url": "https://files.pythonhosted.org/packages/d6/9c/26009faf50f40be88b464b6cdccf434e041c230839c5efed23ff2118c032/py_ball-1.3.tar.gz", "yanked": false, "yanked_reason": null } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8079b5274dbe651a0ffc582f2029efdc", "sha256": "a863eba81ac877a4307acac50a40c27595ff733e7986cadf7398be4bd374c5c8" }, "downloads": -1, "filename": "py_ball-1.3.tar.gz", "has_sig": false, "md5_digest": "8079b5274dbe651a0ffc582f2029efdc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 85286, "upload_time": "2022-01-15T19:36:12", "upload_time_iso_8601": "2022-01-15T19:36:12.555707Z", "url": "https://files.pythonhosted.org/packages/d6/9c/26009faf50f40be88b464b6cdccf434e041c230839c5efed23ff2118c032/py_ball-1.3.tar.gz", "yanked": false, "yanked_reason": null } ], "vulnerabilities": [] }