{ "info": { "author": "Tr-Jono", "author_email": "omgthisissouseless@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Games/Entertainment" ], "description": "# clashroyaleapi v0.2.1\n\nA sync __Python 3.6+__ wrapper for [RoyaleAPI](https://royaleapi.com/). (WIP)\n\nThis wrapper's code style is inspired by\n[python-telegram-bot](https://github.com/python-telegram-bot/python-telegram-bot),\n[Telethon](https://github.com/LonamiWebs/Telethon)\nand [Jeff](https://github.com/jeffffc)'s [crpy](https://test.pypi.org/project/crpy/).\nThis wrapper attempts to provide an alternative which uses dataclasses to the existing Python wrappers for RoyaleAPI.\n\nYou are recommended to read [RoyaleAPI's documentation](https://docs.royaleapi.com) before using this wrapper\nas the documentation for this wrapper is to be written. You may also reference the\n[short examples](https://github.com/Tr-Jono/clashroyaleapi#short-examples-of-using-the-wrapper) below.\n\n_This content is not affiliated with, endorsed, sponsored,\nor specifically approved by Supercell and Supercell is not responsible for it.\nFor more information see [Supercell\u2019s Fan Content Policy](http://supercell.com/en/fan-content-policy/)._\n\n## Installation\nThis project is on [PyPI](https://pypi.org/project/clashroyaleapi/).\n```\npip install clashroyaleapi\n```\n\n## Obtaining Developer Key\nFollow [these instructions](https://docs.royaleapi.com/#/authentication?id=generating-new-keys)\nto obtain your developer key.\n\n## Currently Supported Methods\nMethods with an alias indicate that multiple tags can be passed to them.\n```python\nclient.get_player() # alias: client.get_players()\nclient.get_player_chests() # alias: client.get_players_chests()\nclient.get_player_battles() # alias: client.get_players_battles()\nclient.get_clan() # alias: client.get_clans()\nclient.get_clan_battles()\nclient.get_clan_war()\nclient.get_clan_war_log()\nclient.get_clan_tracking() # alias: client.get_clans_tracking()\nclient.track_clan() # alias: client.track_clans()\nclient.search_clans()\nclient.get_tournament() # alias: client.get_tournaments()\nclient.get_known_tournaments()\nclient.search_tournaments()\nclient.get_top_players()\nclient.get_top_clans()\nclient.get_top_war_clans()\nclient.get_version()\nclient.get_health()\nclient.get_status()\nclient.get_endpoints()\n```\nLists, tuples, dicts, sets and generators can be used when passing arguments to methods accepting multiple tags.\nAll of the following method calls are valid and return the same result.\n```python\np = [tag1, tag2, tag3]\n\nclient.get_players(p)\nclient.get_players(*p)\nclient.get_players(tuple(p))\nclient.get_players(set(p))\nclient.get_players(dict.fromkeys(p))\nclient.get_players(tag for tag in p) # If you want to do this somehow\n```\n\n## Short examples of using the wrapper\nPlayer/Clan/Tournament tags will be \"corrected\" and validated before requesting the API.\n### Example 1: `with` statement\n```python\nimport royaleapi\n\nwith royaleapi.RoyaleAPIClient(\"YOUR_DEVELOPER_KEY\") as client:\n p = client.get_player(\"2RQJ0OYYC\", timeout=100)\n print(p.name, p.stats.favorite_card.name, p.deck[0].name, sep=\", \")\n c1, c2 = client.get_clans(\"c9c8pcp\", \"#8LYRRV2\")\n print(c1.badge == c2.badge, c1.location == c2.location, sep=\", \")\n print([(c.name, c.members[0].name, c.members[0].trophies) for c in (c1, c2)])\n\n# My results:\n# Trainer Jono, Golem, The Log\n# False, True\n# [('\u65b0\u9999\u6e2f\u90e8\u843d123', '\u82b1\u679c\u5c71\u5289\u5fb7\u83ef', 5073), ('\u9999\u6e2f\u90e8\u843d\u00b7\u4e8c\u90e8', 'Gnuelnam', 4479)]\n```\n(2nd clan does not exist anymore, you will get an error trying this.)\n\n### Example 2: Using cached data\n```python\nimport time\nfrom royaleapi import RoyaleAPIClient\n\nclient = RoyaleAPIClient(\"YOUR_DEVELOPER_KEY\", use_cache=True)\nplayer_tag = \"9YJ2RR8G\"\nt1 = time.time()\np1 = client.get_player(player_tag)\nt2 = time.time()\np2 = client.get_player(player_tag)\nt3 = time.time()\np3 = client.get_player(player_tag, use_cache=False)\nt4 = time.time()\nprint(t2 - t1, t3 - t2, t4 - t3, p1 == p2 == p3, sep=\", \")\n\n# My results\n# 2.3867766857147217, 0.28074216842651367, 1.4506447315216064, True\n\n# The first call takes the longest time since the data is not cached locally or on RoyaleAPI's server.\n# The second call takes the shortest time since the data is cached locally.\n# The third call takes less time than the first call since the data is cached on RoyaleAPI's server.\n```\n\n\n", "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/Tr-Jono/clashroyaleapi", "keywords": "clash royale cr crapi royaleapi", "license": "GNU General Public License v3.0", "maintainer": "", "maintainer_email": "", "name": "clashroyaleapi", "package_url": "https://pypi.org/project/clashroyaleapi/", "platform": "", "project_url": "https://pypi.org/project/clashroyaleapi/", "project_urls": { "Homepage": "https://github.com/Tr-Jono/clashroyaleapi" }, "release_url": "https://pypi.org/project/clashroyaleapi/0.2.1/", "requires_dist": [ "requests", "dataclasses ; python_version < \"3.7\"" ], "requires_python": "", "summary": "A sync Python 3.6+ wrapper for RoyaleAPI.", "version": "0.2.1" }, "last_serial": 4656805, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "6bfa96380a753056382cdddecb830719", "sha256": "40dc52680ca672e2422a39f7cde6a7e300deed3b322fdee3a2405a8b56b9d24c" }, "downloads": -1, "filename": "clashroyaleapi-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "6bfa96380a753056382cdddecb830719", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 13507, "upload_time": "2018-06-27T12:29:19", "url": "https://files.pythonhosted.org/packages/87/40/9805c9e566ce718aa7524f5c369769b78cfada6adc859946ae6731e1a250/clashroyaleapi-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2f6a5a47c671b6315f024d040a8b61de", "sha256": "8005262f474abbc9e283f4775a916a949d80b8606dfc89fc5dbd34737b07204e" }, "downloads": -1, "filename": "clashroyaleapi-0.1.0.tar.gz", "has_sig": false, "md5_digest": "2f6a5a47c671b6315f024d040a8b61de", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21059, "upload_time": "2018-06-27T12:29:20", "url": "https://files.pythonhosted.org/packages/ce/e3/bcbe6323839d82620b3cd8a8a3842fe6e9fc994a2ce2bf960d0cd2b7e5f3/clashroyaleapi-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "eeb129cd569b489171d0aa2c4ca22a89", "sha256": "8ba963cb23ce946efaa136ce1538a6315fdd15e3504b1d3fd1cfaca21de1b688" }, "downloads": -1, "filename": "clashroyaleapi-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "eeb129cd569b489171d0aa2c4ca22a89", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 25003, "upload_time": "2018-08-17T09:51:20", "url": "https://files.pythonhosted.org/packages/bf/b9/1451de80472cfaac9e18301afa37713f0d843c3034a534db6119f3a0a238/clashroyaleapi-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8ce4ca7ce4139500df60b8beb1c41b25", "sha256": "dab450c3472056b8c79b58d5b1bc3190176d1629b25f55d31e03721d997142f7" }, "downloads": -1, "filename": "clashroyaleapi-0.1.1.tar.gz", "has_sig": false, "md5_digest": "8ce4ca7ce4139500df60b8beb1c41b25", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22157, "upload_time": "2018-08-17T09:51:21", "url": "https://files.pythonhosted.org/packages/18/73/e24db09ebf11dc4f521445ee227d2a3f88d494de672a5d3d0581019f8d61/clashroyaleapi-0.1.1.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "db5cfceb563a4df214031e625c50f9f4", "sha256": "dd15597713f315d2583c10953a11df761fd3867a3d063d76ae5e5d1ee987c27d" }, "downloads": -1, "filename": "clashroyaleapi-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "db5cfceb563a4df214031e625c50f9f4", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 44440, "upload_time": "2018-12-24T16:54:59", "url": "https://files.pythonhosted.org/packages/22/78/63150eb8d776087d117b51ee444cdf59fe3da230e6319d87c7ff8e41fedf/clashroyaleapi-0.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4c33e88cdb03d69fbbc1c47a234fd254", "sha256": "4e0253cc6769bc2d2dafaeb7c10f90a0754167991185ee92110f912220ca53f4" }, "downloads": -1, "filename": "clashroyaleapi-0.2.0.tar.gz", "has_sig": false, "md5_digest": "4c33e88cdb03d69fbbc1c47a234fd254", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 26719, "upload_time": "2018-12-24T16:55:01", "url": "https://files.pythonhosted.org/packages/76/d4/fcc6a11571c4cbc79048d24e69fd999caa17808be2b1481af4657ef77023/clashroyaleapi-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "38030fea6d13b4cdb78a1d00d15afca9", "sha256": "e30f737b99af831733398c2a7c88d2cd2e77bb3e0ed293e8b9842b81c74ad1eb" }, "downloads": -1, "filename": "clashroyaleapi-0.2.1-py3-none-any.whl", "has_sig": false, "md5_digest": "38030fea6d13b4cdb78a1d00d15afca9", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 44614, "upload_time": "2019-01-03T15:35:43", "url": "https://files.pythonhosted.org/packages/e8/35/2aaeb960a133c76a9df2ddd3487461a4a9b8376b1410d0c06970c79a0093/clashroyaleapi-0.2.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "915a636146f2ce20d506a7852b4b640f", "sha256": "b519d6d809650ba527ddbca0f73e3406240f2fd4a973fe3e888575bc68eed668" }, "downloads": -1, "filename": "clashroyaleapi-0.2.1.tar.gz", "has_sig": false, "md5_digest": "915a636146f2ce20d506a7852b4b640f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 26734, "upload_time": "2019-01-03T15:35:45", "url": "https://files.pythonhosted.org/packages/50/26/f41cca1590df8b4fca7b0d32f2956115bf3b3534436f4c91f353d8c625c8/clashroyaleapi-0.2.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "38030fea6d13b4cdb78a1d00d15afca9", "sha256": "e30f737b99af831733398c2a7c88d2cd2e77bb3e0ed293e8b9842b81c74ad1eb" }, "downloads": -1, "filename": "clashroyaleapi-0.2.1-py3-none-any.whl", "has_sig": false, "md5_digest": "38030fea6d13b4cdb78a1d00d15afca9", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 44614, "upload_time": "2019-01-03T15:35:43", "url": "https://files.pythonhosted.org/packages/e8/35/2aaeb960a133c76a9df2ddd3487461a4a9b8376b1410d0c06970c79a0093/clashroyaleapi-0.2.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "915a636146f2ce20d506a7852b4b640f", "sha256": "b519d6d809650ba527ddbca0f73e3406240f2fd4a973fe3e888575bc68eed668" }, "downloads": -1, "filename": "clashroyaleapi-0.2.1.tar.gz", "has_sig": false, "md5_digest": "915a636146f2ce20d506a7852b4b640f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 26734, "upload_time": "2019-01-03T15:35:45", "url": "https://files.pythonhosted.org/packages/50/26/f41cca1590df8b4fca7b0d32f2956115bf3b3534436f4c91f353d8c625c8/clashroyaleapi-0.2.1.tar.gz" } ] }