{ "info": { "author": "m3fh4q", "author_email": "m3fh4q@yandex.com", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "powerchallonge\n**************\n.. image:: https://travis-ci.org/m3fh4q/powerchallonge.svg?branch=master\n :target: https://travis-ci.org/m3fh4q/powerchallonge\n\npowerchallonge is a client libary for the `Challonge.com API `_.\n\nAll the API Methods are supported.\n\n.. contents:: \n\nPython version compatibility\n############################\n\n- 2.7\n- 3.3+\n\nDependencies\n############\n- **requests**\n\nInstallation\n############\n::\n \n pip install powerchallonge\n\nBasic usage\n###########\n.. code:: python\n\n import challonge\n\n #Configure your settings\n api_key = 'YOURCHALLONGEAPIKEY'\n challonge.set_user_settings(api_key)\n \n\n #Retrieve a set of tournaments created with your account as a Python list of dictionaries\n tournaments = challonge.tournaments.index()\n for tournament in tournaments:\n print(tournament['name'], tournament['id'])\n\n #Retrieve a single tournamentas a Python dictionnary using it's id or challonge like url\n tournament = challonge.tournaments.show(1234)\n print(tournament['name'], tournament['game_name'])\n\nKnown Issues\n############\n- After a participant is checked in using participants.check_in(), the 'checked_in' field remains False but the participant is properly checked in on the site\n- This problem doesn't appear for the participants.undo_check_in(), the field is properly set from True to False when using it\n- Challonge API returns error 500 when Creatin/Updating a match_attachment asset\n- When using match_attachments.update(), the updated field does not seem to get changed when doing a verification with match_attachments.show(), however the update is effective and shows up correctly on the site\n\nAll these issues have been reported to challonge.\n\nRunning the tests\n#################\nThe tests/tests.py script verifies functionality for all the API Methods (except the ones with known issues) and powerchallonge specific functions such as settings configuring and both json and xml conversion functions.\n\n**How to run the tests:**\n\n- Set a CHALLONGE_API_KEY environment variable\n- From the repository's root directory\n\n::\n\n python -m unittest discover -s tests -p \"tests.py\" -v\n\n\n\nAdvanced usage\n##############\n\nPassing parameters\n==================\nSome methods only have positional arguments, some require the keyword argument 'params'\n\nparams should be a dictionnary of the parameters you intend to use in the method.\n\n.. code:: python\n\n myparams = {'subdomain': my_subdomain}\n subdomain_tournaments = challonge.tournaments.index(params=myparams)\n\n myparams2 = {'name': 'tournament1', 'url': 'tournament123123129032901'}\n tournament1 = challonge.tournaments.create(params=myparams2)\n\n\n\nAdvanced user settings\n======================\nBy default, you only need your api key and the set_user_settings() function to use powerchallonge.\n\nYou can use set_user_settings_advanced() for more customization\n\nThe variables below are the default settings if set_user_settings_advanced() isn't called.\n\n.. code:: python\n\n api_key = \"YOURCHALLONGEAPIKEY\" # Your Challonge API key\n\n easy_tournament_identifier = False\n # True to use full URLs for referring to tournaments\n # instead of challonge like URLs.\n # false to use regular challonge API like URLs.\n\n query_type = \".json\"\n # The desired response expected from the challonge API, '.json' or '.xml'\n\n raw_response = False\n # The desired response, False for python like objects : lists, dictionnaries.\n # True for raw response from the API in the form of a Requests Response Object\n # http://docs.python-requests.org/en/master/api/#requests.Response\n\n #Apply the settings\n challonge.set_user_settings_advanced(api_key, easy_tournament_identifier,\n query_type,\n raw_response, verbose_level, test_mode)\n\n\nConvert xml and json files to params\n====================================\n\npowerchallonge comes with tools to convert json or xml files to a dictionnary that can be used agument in the API methods.\nThis allows the user to create custom templates for specific tournaments and save them as .json or .xml and load them easily.\n\nthe functions only supports single parent type json/xml files the childs will be the key:elements in the dictionnary\n\n.. code:: python\n\n myparams = challonge.json_to_params(path_to_json_file)\n myparams = challonge.xml_to_params(path_to_xml_file)\n\nElements are always processed as strings or booleans, if you want an element to be a list (only interesting in the case of participants.bulk_add() ) use the following in your xml file :\n\n::\n\n player1,player2,player3\n\n\nAPI Methods examples list\n=========================\nIf raw_response is set to False (default), the output for any API method used will be a Python object.\n\nIf raw response is set to True, the output for any API method used will be a requests response object.\n\n\nTournaments\n-----------\n`Tournaments : Index `_.\n\n.. code:: python\n\n # params argument is optional\n r = challonge.tournaments.index()\n print(r) # a list of dictionaries of attributes (one dictionary per tournament)\n\n\n`Tournaments : Create `_.\n\n.. code:: python\n\n # params argument is optional but necessary (challonge error later on if missing)\n myparams = {'name': 'mytournament123123', 'url': 'mytournament123123'}\n myparams['start_at']=\"2020/02/16T17:00:00+00:00\"\n #If you don't set an offset (\"+00:00\" above), the hour will be inconsistent\n #Always set your start_time to UTC+your_zone_offset\n r = challonge.tournaments.create(params=myparams)\n print(r) # a dictionary of the attributes of the tournament\n\n`Tournaments : Show `_.\n\n.. code:: python\n\n # params argument is optional\n r = challonge.tournaments.show(identifier)\n print(r) # a dictionary of the attributes of the tournament\n\n`Tournaments : Update `_.\n\n.. code:: python\n \n # params argument is optional but necessary (challonge error later on if missing)\n myparams{'description': 'new_description'}\n r = challonge.tournaments.update(identifier, params=myparams)\n print(r) # a dictionary of the attributes of tournament\n\n`Tournaments : Destroy `_.\n\n.. code:: python\n\n # no params argument required\n r = challonge.tournaments.destroy(identifier)\n print(r) # a dictionary of the attributes of the tournament\n\n`Tournaments : Process Check-ins `_.\n\n.. code:: python\n\n # params argument is optional\n r = challonge.tournaments.process_check_ins(identifier)\n print(r) # a dictionary of the attributes of the tournament\n\n`Tournaments : Abort Check-in `_.\n\n.. code:: python\n\n # params argument is optional\n r = challonge.tournaments.abort_check_ins(identifier)\n print(r) # a dictionary of the attributes of the tournament\n\n`Tournaments : Start `_.\n\n.. code:: python\n\n # params argument is optional\n r = challonge.tournaments.start(identifier)\n print(r) # a dictionary of the attributes of the tournament\n\n`Tournaments : Finalize `_.\n\n.. code:: python\n\n # params argument is optional\n r = challonge.tournaments.finalize(identifier)\n print(r) # a dictionary of the attributes of the tournament\n\n`Tournaments : Reset `_.\n\n\nParticipants\n------------\n.. code:: python\n\n # params argument is optional\n r = challonge.tournaments.reset(identifier)\n print(r) # a dictionary of the attributes of the tournament\n\n`Participants : index `_.\n\n.. code:: python\n\n # params argument is optional\n r = challonge.participants.index(identifier)\n print(r) # a list of dictionnaries of attributes (one dictionnary per participant)\n\n`Participants : Create `_.\n\n.. code:: python\n\n # params argument is optional but necessary (challonge error later on if missing)\n myparams = {'name': 'player1'}\n r = challonge.participants.create(identifier, params=myparams)\n print(r) # a dictionary of the attributes of the participant\n\n`Participants : Bulk-Add `_.\n\n.. code:: python\n\n # params argument is optional but necessary (challonge error later on if missing)\n # For the bulk_add to work, the 'name' field of params must be a list of the names\n myparams = {'name': ['player1', 'player2', 'player3']}\n r = challonge.participants.bulk_add(identifier, params=myparams)\n print(r) # a list of dictionnaries of attributes (one dictionnary per added participant)\n\n`Participants : Show `_.\n\n.. code:: python\n\n # params argument is optional\n r = challonge.participants.show(identifier, participant_id)\n print(r) # a dictionary of the attributes of the participant\n\n\n`Participants : Update `_.\n\n.. code:: python\n\n # params argument is optional but necessary (challonge error later on if missing)\n myparams = {'name': 'player1_update'}\n r = challonge.participants.update(identifier, participant_id, params=myparams)\n print(r) # a dictionary of the attributes of the participant\n\n`Participants : Check-in `_.\n\n.. code:: python\n\n # no params argument required\n r = challonge.participants.check_in(identifier, participant_id)\n print(r) # a dictionary of the attributes of the participant\n #The participant is properly checked-in on the site\n #But the 'checked_in' field will still be set to False, check Known Issues\n\n\n`Participants : Undo Check In `_.\n\n.. code:: python\n\n # no params argument required\n r = challonge.participants.undo_check_in(identifier, participant_id)\n print(r) # a dictionary of the attributes of the participant\n\n`Participants : Destroy `_.\n\n.. code:: python\n\n # no params argument required\n r = challonge.participants.destroy(identifier, participant_id)\n print(r) # a dictionary of the attributes of the participant\n\n`Participants : Randomize `_.\n\n.. code:: python\n\n # no params argument required\n r = challonge.participants.randomize(identifier)\n print(r) # a list of dictionnaries of attributes (one dictionary per participant)\n\n\nMatches\n-------\n`Matches : Index `_.\n\n.. code:: python\n\n # params argument is optional\n r = challonge.matches.index(identifier)\n print(r) # a list of dictionaries of attributes (one dictionary per match)\n\n`Matches : Show `_.\n\n.. code:: python\n\n # params argument is optional\n r = challonge.matches.show(identifier, match_id)\n print(r) # a dictionary of the attributes of the match\n\n`Matches : Update `_.\n\n.. code:: python\n\n # params argument is optional but necessary (challonge error later on if missing)\n myparams = {'scores_csv': '1-0'}\n r = challonge.matches.update(identifier, match_id, params=myparams)\n print(r) # a dictionary of the attributes of the match\n\n`Matches : Reopen `_.\n\n.. code:: python\n\n # no params argument required\n r = challonge.matches.reopen(identifier, match_id)\n print(r) # a dictionary of the attributes of the match\n\n`Match Attachments : Index `_.\n\n.. code:: python\n\n # no params argument required\n r = challonge.match_attachments.index(identifier, match_id)\n print(r) # a list of dictionaries of attributes (one dictionary per match attachment)\n\n\nMatch Attachments\n-----------------\n`Match Attachments : Create `_.\n\n.. code:: python\n\n #Doesn't work if asset is a file (Error 500, check known issues)\n # params argument is optional but necessary (challonge error later on if missing)\n myparams = {'description': 'description'}\n r = challonge.match_attachments.create(identifier, match_id, params=myparams)\n print(r) # a dictionary of the attributes of the match attachment\n\n`Match Attachments : Show `_.\n\n.. code:: python\n\n # no params argument required\n r = challonge.match_attachments.show(identifier, match_id, attachment_id)\n print(r) # a dictionary of the attributes of the match attachment\n\n`Match Attachments : Update `_.\n\n.. code:: python\n\n # params argument is optional but necessary (challonge error later on if missing)\n myparams = {'description': 'new_description'}\n r = challonge.match_attachments.update(identifier, match_id, attachment_id, params)\n print(r) # a dictionary of the attributes of the match attachment\n #the updated field does not seem to get changed when doing a verification \n #with match_attachments.show(), \n #however the update is effective and shows up correctly on the site\n\n`Match Attachments : Destroy `_.\n\n.. code:: python\n\n # no params argument required\n r = challonge.match_attachments.destroy(identifier, match_id, attachment_id)\n print(r) # a dictionary of the attributes of the match attachment", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/m3fh4q/powerchallonge/archive/master.zip", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/m3fh4q/powerchallonge", "keywords": "challonge,library,client,powerchallonge", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "powerchallonge", "package_url": "https://pypi.org/project/powerchallonge/", "platform": "", "project_url": "https://pypi.org/project/powerchallonge/", "project_urls": { "Download": "https://github.com/m3fh4q/powerchallonge/archive/master.zip", "Homepage": "https://github.com/m3fh4q/powerchallonge" }, "release_url": "https://pypi.org/project/powerchallonge/1.0.4/", "requires_dist": null, "requires_python": "", "summary": "challonge.com API client", "version": "1.0.4" }, "last_serial": 3656846, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "00bd54912e0143db40ab0d3e52168b9f", "sha256": "bc52d805a7c11125449460354061c013988f08507fd7a0ed2b21784f7e61f181" }, "downloads": -1, "filename": "powerchallonge-1.0.1.tar.gz", "has_sig": false, "md5_digest": "00bd54912e0143db40ab0d3e52168b9f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10963, "upload_time": "2017-10-08T22:56:03", "url": "https://files.pythonhosted.org/packages/79/20/a561ec50a94153569e0eab377b66f99568285c1a1720c74245897c074d20/powerchallonge-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "642513e8830b5c4daee952768f0129e2", "sha256": "43cd06b866939c3c08f0ed1e4bbdcaf4030fef093f4e48a2d8532ef9c3c1193e" }, "downloads": -1, "filename": "powerchallonge-1.0.2.tar.gz", "has_sig": false, "md5_digest": "642513e8830b5c4daee952768f0129e2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12110, "upload_time": "2017-10-09T09:26:10", "url": "https://files.pythonhosted.org/packages/4c/da/ae6a985d28aecf90a5f1f2bfd41d081fc7f1b7589f00f196f4a511c89b97/powerchallonge-1.0.2.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "98e52d85bca4d0d3b64b86198f5e9bb4", "sha256": "9bb3cb6f7bb877619073d437edc71d85d46d72a65bc474d0b8b857ab47a03449" }, "downloads": -1, "filename": "powerchallonge-1.0.3.tar.gz", "has_sig": false, "md5_digest": "98e52d85bca4d0d3b64b86198f5e9bb4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14103, "upload_time": "2018-03-07T21:40:43", "url": "https://files.pythonhosted.org/packages/77/85/163edadcd3c73ad62f5c57ef7830775567dc207f476f8d8f97ae63f8ace0/powerchallonge-1.0.3.tar.gz" } ], "1.0.4": [ { "comment_text": "", "digests": { "md5": "af865fde51be9962895b110781351a63", "sha256": "4e17d6b7588f02b927f5393bf8bbd435be06f46e878279b0e26760ea54aeb2ec" }, "downloads": -1, "filename": "powerchallonge-1.0.4.tar.gz", "has_sig": false, "md5_digest": "af865fde51be9962895b110781351a63", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14182, "upload_time": "2018-03-10T11:48:59", "url": "https://files.pythonhosted.org/packages/84/26/2c3f85439e4b7bcd2a86e60e73f51a11d7467265abd2d6b62b3715579428/powerchallonge-1.0.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "af865fde51be9962895b110781351a63", "sha256": "4e17d6b7588f02b927f5393bf8bbd435be06f46e878279b0e26760ea54aeb2ec" }, "downloads": -1, "filename": "powerchallonge-1.0.4.tar.gz", "has_sig": false, "md5_digest": "af865fde51be9962895b110781351a63", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14182, "upload_time": "2018-03-10T11:48:59", "url": "https://files.pythonhosted.org/packages/84/26/2c3f85439e4b7bcd2a86e60e73f51a11d7467265abd2d6b62b3715579428/powerchallonge-1.0.4.tar.gz" } ] }