{ "info": { "author": "Darqi", "author_email": "", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Games/Entertainment :: Real Time Strategy", "Topic :: Games/Entertainment :: Role-Playing", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Text Processing" ], "description": "# Riot-Observer **v1.3.3**\n\nRiot-Observer is a light wrapper of the [Riot Games API for League of Legends](https://developer.riotgames.com/). With the release of the v3 endpoints and the [API Versioning and deprecation policy](https://developer.riotgames.com/api-versioning.html/), major part of old methods are deprecated from **7/24/17**. Based on the pseudonym117's work [RiotWatcher](https://github.com/pseudonym117/Riot-Watcher), I tried to update all\nthe methods. All game constants are also included in variable file. Requests are kept track of so that you can stay below your rate limit. The default rate limits are set to 10 requests every 10 seconds and 500 requests every 10 minutes (the limit for development keys). The rate limiter does not prevent you from making requests that will be blocked and cause an exception, it simply allows you to check if you request will go through.\n\n### Summary\n- [API Versions](#api-versions)\n- [Getting started](#getting-started)\n- [Usage](#usage)\n- [Testing](#testing)\n- [Changelog](#changelog)\n\n### API Versions\nAPI | Version | Supported\n----|---------|-----------\nchampion | v3 | v3\nspectator | v3 | v3\nmatch | v3 | v3\nleague | v3 | v3\nlol-static-data | v3 | v3\nlol-status | v3 | v3\nsummoner | v3 | v3\nchampion-mastery | v3 | *not yet implemented*\nmasteries | v3 | *not yet implemented*\nrunes | v3 | *not yet implemented*\n\n### Getting started\n\nTo install Riot-Observer:\n\n``\npip install riot_observer\n``\n\nOR:\n\n``Python\npython setup.py install\n``\n\nYou also need to have an API key from Riot. Get that from\n[here](https://developer.riotgames.com/).\n\n### Usage\n\nAll methods return dictionaries representing the json objects described\nby the official [Riot API](https://developer.riotgames.com/api-methods/). Any error (e.g. 404) that are known to the\nservice are returned as custom objects (error_404, error_500, ...),\nfor you to deal with however you like. Any other HTTP errors that are\nnot known returns of the API are raised as exceptions as in the Requests\nAPI.\n\nDefault region of this application is EUW, but that can be changed during\ninitialization.\n\n```Python\n\nfrom riot_observer import RiotObserver\n\nw = RiotObserver('')\n\n# check if we have API calls remaining\nprint(w.can_make_request())\n\n# Get summoner's infos\na_guy = w.get_summoner_by_name(summoner_name='Puchi Otaku')\nprint(a_guy)\n\n# Get summoner's ranked matches\nranked_games = w.get_matchlist(account_id=a_guy['accountId'])\nprint(ranked_games)\n\n# all static methods are prefaced with 'static'\n# static requests do not count against your request limit\n# but at the same time, they don't change often...\nstatic_champ_list = w.static_get_champion_list()\nprint(static_champ_list)\n\n# import constants like region codes, or game constants\nfrom riot_observer import constants as c\n\n# request data from NA\ncreator = w.get_summoner_b(summoner_name='pseudonym117', region=c.NORTH_AMERICA)\nprint(creator)\n\n# create watcher with NA as its default region\nna = RiotObserver('', default_region=c.NORTH_AMERICA)\n\n# proper way to send names with spaces is to remove them, still works with spaces though (the wrapper includes a sanitize function)\nxpeke = w.get_summoner(name='fnaticxmid')\nprint(xpeke)\n\n# Error checking requires importing LoLException as well as any errors you wish to check for.\n# For Riot's API, the 404 status code indicates that the requested data wasn't found and\n# should be expected to occur in normal operation, as in the case of a an invalid summoner name,\n# match ID, etc.\n# The 429 status code indicates that the user has sent too many requests\n# in a given amount of time (\"rate limiting\").\n\nfrom riot_observer import LoLException\nfrom riot_observer.observer import error_404, error_429\n\ntry:\n response = w.get_summoner_by_name('a dude')\nexcept LoLException as e:\n if e == error_429:\n print('We should retry in {} seconds.'.format(e.headers['Retry-After']))\n elif e == error_404:\n print('Summoner not found.')\n\n```\n\nI'm writing a full API reference with all available methods in this wrapper.\n\n### Testing\n\nThe tests included are not perfect, and don't have full code\ncoverage, but they should detect most issues.\nTo run these tests (to make sure its the API f-ing up not your code):\n\n- Run **test.py** and enter your API key\n- Enter a summoner name\n- Then just follow the instructions (\"Press enter to continue...\", it's not too difficult)\n- You can modify the test.py file to test more methods!\n\n### Changelog\n\nRiot-Observer's changelog\n```\nv1.3.3 - 06/11/2017\n\nEndpoints updates:\n - updated champion API to v3\n - updated spectator API to v3\n - updated match API to v3\n - updated league API to v3\n - updated lol-static-data API to v3\n - updated lol-status API to v3\n - updated summoner API to v3\n\nMethods added and modified.\nFull documentation coming soon.\n```\n\nRiotWatcher's changelog\n```\nv1.3.2 - 11/16/2015\n\nfixed issue with special characters in names in get_summoners method (issue #28)\n\nfixed bug in matchlist API causing requests for past seasons to fail,\nadded constants for each possible season. (issue #44)\n\nfixed bug introduced in pull request #35\n(method of checked for what exception is thrown changed from what was documented) - old method should work now. (issue #43)\n\nv1.3.1 - 10/24/2015\n\nremoved match history functions, as these were deprecated.\n\nv1.3 - 7/29/2015\n\nmerged pull requests to (done at previous date, changelog not updated):\n - use matchlist endpoint\n - use nemesis draft\n - use riot attribution\n - get master tier\n\nfixed issue with merged matchlist endpoint tests\nfixed issue #24 in readme\nadded black market brawlers constants\n\nv1.2.5 - 3/8/2015\n\nfixed issue with __init__.py not importing the correct packages\n\nv1.2.4 - 2/13/2015\n\nAdded current-game-v1.0 and featured-games-v1.0 api's\n\nv1.2.3 - 12/31/2014\n\nFixed bug/undocumented feature when getting a single summoner with space\nin the name. Also added static method\n``RiotWatcher.sanitize_name(name)`` for stripping special characters\nfrom summoner names.\n\nv1.2.2 - 12/22/2014\n\nTiny changes, function signature of get\\_summoner changed, to get by ID\nthe keyword is now ``_id``, not ``id``, tests updated to reflect this\n\nSome game constants updated, if anyone has actually been using them.\n\nv1.2.1 - 10/14/2014\n\nAdd lol-status API. not a huge thing but i had time to do it.\n\nv1.2 - 9/4/2014\n\nAdded Match and MatchHistory APIs! Also are somewhat tested, but query\nparameters are not tested.\n\nAdded some new constants. Probably not useful, but who knows. Maybe\nsomeone will want them.\n\nSome code changed to look slightly nicer too.\n\nv1.1.8 - 9/4/2014\n\nUpdated APIs supported. Updated APIs:\n\n- league-v2.5\n- team-v2.4\n\nDon't worry, support for match data is coming. I just wanted to commit\nthese changes first, since they already had tests.\n\nv1.1.7 - 8/10/2014\n\nFixed issue #4 (forgot to change a number, oops) and made it much much\nless likely for me to do it again (moved api version part of url into a\ndifferent method just to be sure I don't mess it up).\n\nAlso there are now TESTS!! WOO! Everyone rejoice. They aren't very good\ntests though, so don't be too excited. BUT if they should detect if\nthere's a clear issue in the API wrapper.\n\nOh and some better formatting done (spaces not tabs, more consistent\nindentation, etc.). Should be no functional difference at all.\n\nv1.1.6 - 6/19/2014\n\nAdded support for regional proxies, because EUW broke without it\n\nv1.1.5 - 5/9/2014\n\nCause what do version numbers really mean anyways?\n\nActually add endpoints to league API that I just forgot to add. Change\nis NOT backwards compatible, any use of the old league api calls will\nneed to be changed, in addition to the riot changes.\n\nNewly supported API's: - league-v2.4 - team-v2.3\n\nv1.1.1 - 5/3/2014\n\nFix issue with static calls, namely that they didn't do anything right\nbefore. Now they work.\n\nv1.1 - 4/29/2014\n\nUpdated to latest API versions, now supported API's are:\n\n- champion-v1.2\n- game-v1.3\n- league-v2.3\n- lol-static-data-v1.2\n- stats-v1.3\n- summoner-v1.4\n- team-v2.2\n\nChanges are NOT backwards compatible, you will need to update any code\nthat used an old API version. Check `Riots\ndocumentation `__ for\nmore information on what changes were made\n\nv1.0.2 - 2/25/2014\n\nAdded Riots new methods to get teams by id. In methods\n'get\\_teams(team\\_ids, region)' and 'get\\_team(team\\_id, region)'.\n\nv1.0.1a\n\nAlpha only, experimental rate limiting added\n\nv1.0\n\nInitial release\n```\n\n### Attribution\n\nRiot-Observer isn't endorsed by Riot Games and doesn't reflect the views or opinions of Riot Games or anyone officially involved in producing or managing *League of Legends*. *League of Legends* and Riot Games are trademarks or registered trademarks of Riot Games, Inc. *League of Legends* (c) Riot Games, Inc.\n\nRiot-Observer is based on [RiotWatcher](https://github.com/pseudonym117/Riot-Watcher) writing by ***pseudonym117***\n\n\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Darquiche/Riot-Observer", "keywords": "league of legends riot games api wrapper development python", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "riot-observer", "package_url": "https://pypi.org/project/riot-observer/", "platform": "", "project_url": "https://pypi.org/project/riot-observer/", "project_urls": { "Homepage": "https://github.com/Darquiche/Riot-Observer" }, "release_url": "https://pypi.org/project/riot-observer/1.3.3/", "requires_dist": [ "requests" ], "requires_python": "", "summary": "Python light wrapper for the Riot Games API for League of Legends", "version": "1.3.3" }, "last_serial": 2942131, "releases": { "1.3.3": [ { "comment_text": "", "digests": { "md5": "bf7effc067c3211d9a2734b2afddfb24", "sha256": "f69ccc16f64f116849f5f77794552b57d58a53f145d2280290d2a2ff91356d9a" }, "downloads": -1, "filename": "riot_observer-1.3.3-py3-none-any.whl", "has_sig": false, "md5_digest": "bf7effc067c3211d9a2734b2afddfb24", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 14790, "upload_time": "2017-06-11T14:54:08", "url": "https://files.pythonhosted.org/packages/65/d9/8102959b0c039862d378b19f88d1ae039566fe7ac0f7a9d6906ffd5ffb11/riot_observer-1.3.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4eeca8b6d7fab83dd283e83a29d61773", "sha256": "1e87aa5539b8851e013a6da73d5278ac3e7346280e64cfa72c827e65ec961c9d" }, "downloads": -1, "filename": "riot_observer-1.3.3.tar.gz", "has_sig": false, "md5_digest": "4eeca8b6d7fab83dd283e83a29d61773", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14143, "upload_time": "2017-06-11T14:54:10", "url": "https://files.pythonhosted.org/packages/4c/23/a50e1c29d607917c604238d2011aac984e61e6fa1ebaa0bd3e97fc6d0b0d/riot_observer-1.3.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "bf7effc067c3211d9a2734b2afddfb24", "sha256": "f69ccc16f64f116849f5f77794552b57d58a53f145d2280290d2a2ff91356d9a" }, "downloads": -1, "filename": "riot_observer-1.3.3-py3-none-any.whl", "has_sig": false, "md5_digest": "bf7effc067c3211d9a2734b2afddfb24", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 14790, "upload_time": "2017-06-11T14:54:08", "url": "https://files.pythonhosted.org/packages/65/d9/8102959b0c039862d378b19f88d1ae039566fe7ac0f7a9d6906ffd5ffb11/riot_observer-1.3.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4eeca8b6d7fab83dd283e83a29d61773", "sha256": "1e87aa5539b8851e013a6da73d5278ac3e7346280e64cfa72c827e65ec961c9d" }, "downloads": -1, "filename": "riot_observer-1.3.3.tar.gz", "has_sig": false, "md5_digest": "4eeca8b6d7fab83dd283e83a29d61773", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14143, "upload_time": "2017-06-11T14:54:10", "url": "https://files.pythonhosted.org/packages/4c/23/a50e1c29d607917c604238d2011aac984e61e6fa1ebaa0bd3e97fc6d0b0d/riot_observer-1.3.3.tar.gz" } ] }