{ "info": { "author": "Jennie Lees ", "author_email": "jennielees@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "leagueoflegends-python\n==========\n\n*This product is not endorsed, certified or otherwise approved in any way by Riot Games, Inc. or any of its affiliates.*\n\n###Quickstart\n\n pip install leagueoflegends\n\n from leagueoflegends import LeagueOfLegends, RiotError\n lol = LeagueOfLegends('your-api-key')\n\n # Call the API with explicit summoner ID\n id = lol.get_summoner_by_name('your-summoner-name')\n lol.get_games(id)\n\n # Or set the ID globally for all future calls\n lol.set_summoner('your-summoner-name')\n lol.get_summoner_stats()\n lol.get_summoner_ranked_stats()\n\n # Access data through dictionaries\n try:\n teams = lol.get_summoner_teams()\n for t in teams:\n print t[\"name\"]\n for m in t[\"roster\"][\"memberList\"]:\n id = m[\"playerId\"]\n print id\n print lol.get_summoner_by_id(id)[\"name\"]\n except RiotError, e:\n print e.error_msg\n\n###Words\n\nThis is an unofficial Python Library for the official League of Legends API (Riot Developer API), wrapping HTTP calls into Python dictionaries.\n\nFull documentation for Riot's RESTful API is [here](https://developer.riotgames.com/api/). Dictionaries returned by this library corresponds to the datatypes documented there.\n\nLibrary code is distributed under the [WTFPL](http://www.wtfpl.net/). You are free to modify and redistribute. Attribution is a nice touch, and I'd love to hear what you get up to with this library.\n\n###General Usage\n\nThe Riot Developer API does not support anonymous access. You must [register for an API key](https://developer.riotgames.com/) with Riot before using this API.\n\n\n from leagueoflegends import LeagueOfLegends\n lol = LeagueOfLegends('your-api-key')\n\n####get_champions ([API Doc](https://developer.riotgames.com/api/methods#!/311))\n\nReturns a list of all champions. Optionally only return free to play champions.\n\n champs = lol.get_champions(free_to_play=False)\n for champ in champs:\n print champ[\"name\"]\n\n###Summoner-Specific Methods\n\n####get_summoner_games ([API Doc](https://developer.riotgames.com/api/methods#!/313/1061))\n\nReturns a list of recent games played by a specific summoner, up to 10.\n\nTakes a specific `summoner_id` (long) argument. If you want to query by summoner name, add a second lookup (see below).\n\n games = lol.get_summoner_games(12345678)\n for game in games:\n print game[\"championId\"]\n\n####get_summoner_leagues ([API Doc](https://developer.riotgames.com/api/methods#!/307/1055))\n\nReturns the leagues associated with a specific summoner ID.\n\n leagues = lol.get_summoner_leagues(12345678)\n for queue_type in leagues:\n print leagues[queue_type][\"tier\"]\n\n####get_summoner_stats ([API Doc](https://developer.riotgames.com/api/methods#!/317/1075))\n\nReturns summary stats (aggregate over all champions) for a specific summoner ID.\n\n stats = lol.get_summoner_stats(12345678)\n for stat in stats:\n print stat[\"aggregatedStats\"][\"totalAssists\"]\n\n####get_summoner_ranked_stats ([API Doc](https://developer.riotgames.com/api/methods#!/317/1074))\n\nReturns aggregated stats, summarized per champion, from ranked matches. Includes statistics for Twisted Treeline and Summoner's Rift.\n\n rankedstats = lol.get_summoner_ranked_stats(12345678)\n for champ in stats:\n print champ[\"id\"]\n\n####get_summoner_by_id ([API Doc](https://developer.riotgames.com/api/methods#!/315/1069))\n\nReturns basic information about a specific summoner ID (name, level, etc).\n\n summoner = lol.get_summoner_by_id(12345678)\n print summoner[\"name\"]\n\n####get_summoner_by_name ([API Doc](https://developer.riotgames.com/api/methods#!/315/1067))\n\nReturns the same information as `get_summoner_by_id` but queried by name.\n\n summoner = lol.get_summoner_by_name('RiotPhreak')\n print summoner[\"id\"]\n\n####get_summoner\n\nConvenience shortcut to the above two functions. Takes either an ID or a name and returns the summoner object.\n\n summoner = lol.get_summoner('RiotPhreak')\n print summoner[\"id\"]\n\n summoner = lol.get_summoner('12345678')\n print summoner[\"name\"]\n\n####get_summoner_id_from_name\n\nConvenience shortcut to retrieving a summoner ID given a specific name, as per the `get_summoner_by_name` example snippet above.\n\n summoner_id = lol.get_summoner_by_name('RiotPhreak')\n stats = lol.get_summoner_stats(summoner_id)\n ...\n\n####get_summoner_names ([API Doc](https://developer.riotgames.com/api/methods#!/315/1068))\n\nGet up to 40 summoner names at once from a list of summoner IDs.\n\n summoner_ids = [1234, 5678, 12345678]\n summoner_names = lol.get_summoner_names(summoner_ids)\n for summoner in summoner_names:\n print summoner[\"name\"]\n\n\n####get_summoner_masteries ([API Doc](https://developer.riotgames.com/api/methods#!/315/1071))\n\nGet mastery pages for a specific summoner ID.\n\n masteries = lol.get_summoner_masteries(12345678)\n for page in masteries:\n for talent in page[\"talents\"]:\n print talent[\"name\"]\n\n####get_summoner_runes ([API Doc](https://developer.riotgames.com/api/methods#!/315/1070))\n\nGet rune pages for a specific summoner ID.\n\n runes = lol.get_summoner_runes(12345678)\n for page in runes:\n for slot in page[\"slots\"]:\n print slot[\"rune\"][\"name\"] + ' '\\\n + slot[\"rune\"][\"description\"]\n\n\n\n####get_summoner_teams ([API Doc](https://developer.riotgames.com/api/methods#!/310/1058))\n\nGet team information for a specific summoner. Can return multiple teams.\n\n teams = lol.get_summoner_teams(12345678)\n\n for team in teams:\n print team[\"name\"]\n\n for team in teams:\n for match in t[\"matchHistory\"]:\n total_wins += 1 and match[\"win\"]\n print total_wins\n\n\n####set_summoner\n\nConvenience function to set summoner ID from name. Summoner-specific functions can be called without an ID argument if this has been set.\n\n lol.set_summoner(\"RiotPhreak\")\n lol.get_summoner_stats()\n lol.get_summoner_teams()\n\n####get_games, get_leagues, get_stats, get_ranked_stats\n\nIf you're tired of typing 'summoner', these convenience functions might help.\n\n###Config\n\n####set_api_region\n\nTakes a region as argument and executes all further API calls against that region.\n\nValid regions: `euw, eune, na, tr, br`.\n\nNote: not all API functions support all regions. Check Riot documentation if you run into weird errors. At time of writing, `na, euw, eune` regions are valid for all calls.\n\n####set_api_version\n\nTakes a version as argument, and sets it for future API calls. However, note that many API requests have the version hardcoded since there is variance between supported versions for each call. Where multiple versions of a specific endpoint are available, the newest version is used.\n\n###Rate Limits\n\nAt time of writing, the Riot API limit is 10 requests every 10 seconds and 500 requests every 10 minutes. You will encounter a `RiotError` if you exceed this limit.\n\nConsider your API request design wisely, and note that looking up a summoner ID from name is its own API call (although these queries are cached temporarily).\n\n try:\n for summoner in very_long_summoner_list:\n lol.get_summoner_by_name(summoner)\n except RiotError, e:\n print e.error_msg\n\n###Tests\n\nTests are in `test_leagueoflegends.py` and the easiest way to run them is with [Nose](http://nose.readthedocs.org/en/latest/):\n\n pip install nose\n nosetests", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/jennielees/leagueoflegends-python", "keywords": null, "license": "WTFPL", "maintainer": null, "maintainer_email": null, "name": "leagueoflegends", "package_url": "https://pypi.org/project/leagueoflegends/", "platform": "any", "project_url": "https://pypi.org/project/leagueoflegends/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/jennielees/leagueoflegends-python" }, "release_url": "https://pypi.org/project/leagueoflegends/1.4/", "requires_dist": null, "requires_python": null, "summary": "Unofficial libraries for interacting with the official League of Legends API", "version": "1.4" }, "last_serial": 1275499, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "fb1b23f3e9c014d9ef366c0b8d1b8e88", "sha256": "ed59365b70a97ae0181e2faeb80f81bd9ed8dd1c0db8306580ae38c8b727946e" }, "downloads": -1, "filename": "leagueoflegends-0.1.tar.gz", "has_sig": false, "md5_digest": "fb1b23f3e9c014d9ef366c0b8d1b8e88", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6621, "upload_time": "2013-12-23T06:54:09", "url": "https://files.pythonhosted.org/packages/d2/bb/596a8eb8337f34d4a001188bc37119fbd2007d15554c2320b834284bc78f/leagueoflegends-0.1.tar.gz" } ], "0.11": [ { "comment_text": "", "digests": { "md5": "b43c162d6956b6a66d445cb54fd6f314", "sha256": "ea87a663cce3fabbcfd7b78646aac7ded0ea50ac9e1625c8c06d0386a6249ceb" }, "downloads": -1, "filename": "leagueoflegends-0.11.tar.gz", "has_sig": false, "md5_digest": "b43c162d6956b6a66d445cb54fd6f314", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7051, "upload_time": "2013-12-23T07:15:26", "url": "https://files.pythonhosted.org/packages/94/52/6f9acb21d1190ec7bb70b26849d925bf340a9a8e81a576b4e917c0b3dfe7/leagueoflegends-0.11.tar.gz" } ], "0.12": [ { "comment_text": "built for Darwin-12.5.0", "digests": { "md5": "2d4972a3e333dcac821d7f743f1fd54c", "sha256": "ae4bd8b479e5f3941bf1614e45cd1a3514ac382360cf9c29fae3654fe25f9a53" }, "downloads": -1, "filename": "leagueoflegends-0.12.macosx-10.8-x86_64.tar.gz", "has_sig": false, "md5_digest": "2d4972a3e333dcac821d7f743f1fd54c", "packagetype": "bdist_dumb", "python_version": "any", "requires_python": null, "size": 9460, "upload_time": "2014-01-05T02:11:55", "url": "https://files.pythonhosted.org/packages/00/2c/35d789dd8ef755134b9a2242e79ec60b4971a9cf2cb27eeea5c1c5274c60/leagueoflegends-0.12.macosx-10.8-x86_64.tar.gz" }, { "comment_text": "", "digests": { "md5": "98480c5f5866e33699852ea04a25bba0", "sha256": "93112ced7339c8a00671c73d72461328f20a2bfee0db694b37f44f13208f2f8c" }, "downloads": -1, "filename": "leagueoflegends-0.12.tar.gz", "has_sig": false, "md5_digest": "98480c5f5866e33699852ea04a25bba0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7211, "upload_time": "2014-01-05T02:11:53", "url": "https://files.pythonhosted.org/packages/dd/aa/aa57c17f2e67fe304a42dab6f8badb8ea38ed6f68cb42d94b9f82c7adc14/leagueoflegends-0.12.tar.gz" } ], "1.4": [ { "comment_text": "", "digests": { "md5": "ab991de7ea3fb6d2cf596878525874fb", "sha256": "b85520ac0a8d43f7ccc4c9f22e1cd70642af1b9cce0b0bdddf58bb103e7e0219" }, "downloads": -1, "filename": "leagueoflegends-1.4.tar.gz", "has_sig": false, "md5_digest": "ab991de7ea3fb6d2cf596878525874fb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8464, "upload_time": "2014-10-19T07:28:11", "url": "https://files.pythonhosted.org/packages/6a/ec/8598ee58ab3bb8aa75f9709d9fe0a6969fec413bdf015789cc93239b875c/leagueoflegends-1.4.tar.gz" } ], "1.4b": [ { "comment_text": "", "digests": { "md5": "368c8e1b6a8c3ba26e410025874a6e56", "sha256": "c1d7f2967adb2e23d5d5108db467f544a16604badb936c6798017b79aa870ccb" }, "downloads": -1, "filename": "leagueoflegends-1.4b.tar.gz", "has_sig": false, "md5_digest": "368c8e1b6a8c3ba26e410025874a6e56", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9167, "upload_time": "2014-10-19T07:56:13", "url": "https://files.pythonhosted.org/packages/f7/1f/b60c2457adf11b647d3d379482c03e3ff6fba02b4db8ec5d586aed0e9a90/leagueoflegends-1.4b.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ab991de7ea3fb6d2cf596878525874fb", "sha256": "b85520ac0a8d43f7ccc4c9f22e1cd70642af1b9cce0b0bdddf58bb103e7e0219" }, "downloads": -1, "filename": "leagueoflegends-1.4.tar.gz", "has_sig": false, "md5_digest": "ab991de7ea3fb6d2cf596878525874fb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8464, "upload_time": "2014-10-19T07:28:11", "url": "https://files.pythonhosted.org/packages/6a/ec/8598ee58ab3bb8aa75f9709d9fe0a6969fec413bdf015789cc93239b875c/leagueoflegends-1.4.tar.gz" } ] }