{ "info": { "author": "", "author_email": "", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License v2 (GPLv2)", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "GamesAPIClient\n==============\n\n.. image:: https://travis-ci.com/simplworld/simpl-client.svg?token=cyqpBgqLC1o8qUptfcpE&branch=master\n :target: https://travis-ci.com/simplworld/simpl-client\n\n\nPython clients for asynchronously accessing simpl-games-api.\n\nUsage::\n\n from simpl_client.async import GamesAPIClient\n async_games_client = GamesAPIClient(url=SIMPL_GAMES_URL, auth=SIMPL_GAMES_AUTH)\n\nto synchronously access simpl-games-api use::\n\n from simpl_client.sync import GamesAPIClient\n sync_games_client = GamesAPIClient(url=SIMPL_GAMES_URL, auth=SIMPL_GAMES_AUTH)\n\nInstallation\n------------\n::\n\n pip install simpl-client\n\nEndpoints\n---------\n\nEndpoints are available as properties on the main instance.\n\n``.all()``\n~~~~~~~~~~\n\nRetrieves all resources (essentially a simple ``GET`` on the endpoint)::\n\n async_games_client.runusers.all() # GET /runusers/\n\n``.filter(**kwargs)`` calls a ``GET`` with ``kwargs`` as querystring values::\n\n async_games_client.runusers.filter(run=12, world=1) # GET /runusers/?run=12&world=1\n\n``.get(**kwargs)``\n~~~~~~~~~~~~~~~~~~\n\nA special case of ``.filter()``.\n\nIf ``kwargs`` contains ``id``, ``pk``, ``slug`` or ``username``, that value will\nbe used in the URL path, in that order.\n\nOtherwise, it calls a ``GET`` with ``kwargs`` as querystring values.\n\nIf the returned list is empty, will raise ``ResourceNotFound``.\n\nIf the returned list contains more than 1 resource, will raise ``MultipleResourcesFound``\n\nNote that ``.get()`` will return a ``Resource``, not a list of ``Resource`` s\n\n::\n\n async_games_client.runusers.filter(run=12, world=1) # GET /runusers/?run=12&world=1\n async_games_client.runusers.filter(id=12) # GET /runusers/12/\n async_games_client.users.filter(username='alice') # GET /users/alice/\n\n``.create(payload)``\n~~~~~~~~~~~~~~~~~~~~\n\nWill result in a ``POST``, with ``payload`` (a ``dict``) as the request's body,\nreturning a new ``Resource``::\n\n runuser = async_games_client.runusers.create({'run': 12, 'world': 1}) # POST /runusers/\n\n``.get_or_create(defaults, **kwargs)``\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nIssues a GET to fetch the resource. If the resource is not found, issues a POST\nto create the resource.\n\n # Assuming it doesn't exist\n run = myclient.run.get_or_update(game=12, defaults={'active': True}) # GET /runs/?game=12, then POST /runs/\n\n\n``.create_or_update(payload)``\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nIf ``payload`` contains a key called ``'id'``, will issue a ``PUT``, otherwise\nit will call ``.create``::\n\n runuser = async_games_client.runusers.create_or_update({'id': 1234, 'world': 1}) # PUT /runusers/1234/\n\n\n``.delete(pk)``\n~~~~~~~~~~~~~~~\n\nWill issue a ``DELETE``, and will use ``pk`` as part of the URL::\n\n async_games_client.runusers.delete(24) # DELETE /runusers/24/\n\nResources\n---------\n\nAll endpoints methods (with the exception of ``.delete()``) return either a\n``Resource`` or a list of ``Resource`` s.\n\nA ``Resource`` is just a wrapping class for a ``dict``, where keys can be accessed\nas properties.\n\nAdditionally, ``Resource`` s have a special property called ``.payload``, which\ncontains the original payload received from the server.\n\n``Resource`` s have the following methods:\n\n``Resource.delete()`` will result in a ``DELETE``, with ``Resource.id`` as\npar of the URL::\n\n runuser = async_games_client.runusers.create({'run': 12, 'world': 1}) # POST /runusers/\n runuser.delete() # DELETE /runuser/345/ -- the ID 345 was returned by the server in the previous response\n\n``Resource.save()`` will result in a ``PUT``, with ``Resource.id`` as\npar of the URL::\n\n runuser = async_games_client.runusers.create({'run': 12, 'world': 1}) # POST /runusers/\n runuser.run = 13\n runuser.save() # PUT /runuser/345/\n\n\nBulk requests\n-------------\n\n::\n\n async_games_client.bulk.results.create([...], return_ids=False)\n async_games_client.bulk.results.delete(**lookup)\n\n\nDetail Routes\n-------------\n\n::\n\n async_games_client.scenario(id=123).rewind()\n\n\nSetup development environment\n-----------------------------\n::\n\n git clone git@github.com:simplworld/simpl-client.git\n cd simpl-client\n mkvirtualenv simpl-client\n pip install -e .\n\nTesting\n-------\n::\n\n python setup.py test\n\nRunning the tests requires having ``libmagic`` installed.\n\nOn OS X, simply run ``brew install libmagic``.\n\nLicense\n-------\n\nCopyright \u00a9 2018 The Wharton School,\u00a0\u00a0The University of Pennsylvania\u00a0\n\nThis program is free software; you can redistribute it and/or\nmodify it under the terms of the GNU General Public License\nas published by the Free Software Foundation; either version 2\nof the License, or (at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/simplworld/simpl-client", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "simpl-client", "package_url": "https://pypi.org/project/simpl-client/", "platform": "", "project_url": "https://pypi.org/project/simpl-client/", "project_urls": { "Homepage": "https://github.com/simplworld/simpl-client" }, "release_url": "https://pypi.org/project/simpl-client/0.7.5/", "requires_dist": [ "genericclient-aiohttp (<1.4,>=1.3)", "genericclient (<1.4,>=1.3)" ], "requires_python": "", "summary": "Python clients for accessing simpl-games-api", "version": "0.7.5" }, "last_serial": 4621552, "releases": { "0.7.2": [ { "comment_text": "", "digests": { "md5": "fd09712ff7b232765cf4844f22351ca9", "sha256": "dcbea6c66f873222c341c7b1aa83184046b3b0d503d5169919e108b8be06b256" }, "downloads": -1, "filename": "simpl_client-0.7.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "fd09712ff7b232765cf4844f22351ca9", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 6732, "upload_time": "2018-09-14T14:05:42", "url": "https://files.pythonhosted.org/packages/45/f8/ad15e4e810e260e0bf2db5c09ca81fd3c1dbcdc57e004974c6034dc4140c/simpl_client-0.7.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "03fe1b31b30dd3edbe04a9f7fb302f53", "sha256": "50e6f2d4afaeac353b9d0b60e6056bb4cbe7ef03dc4571311b17bba6a4f69997" }, "downloads": -1, "filename": "simpl_client-0.7.2.tar.gz", "has_sig": false, "md5_digest": "03fe1b31b30dd3edbe04a9f7fb302f53", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5228, "upload_time": "2018-09-14T14:05:43", "url": "https://files.pythonhosted.org/packages/4d/6b/280d5dabf00d9a6ebcbb143cb059030e20d66e58820f71191924e1cd10b6/simpl_client-0.7.2.tar.gz" } ], "0.7.3": [ { "comment_text": "", "digests": { "md5": "7f0f6e4ed96cb3d9ccc6d94ccaa42105", "sha256": "8eae5c778095575b5b6cbd9158d45ac97e734ea48a416eb69b11b915424dfc57" }, "downloads": -1, "filename": "simpl_client-0.7.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "7f0f6e4ed96cb3d9ccc6d94ccaa42105", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 6721, "upload_time": "2018-09-14T14:59:20", "url": "https://files.pythonhosted.org/packages/42/e4/6c7103b40abd835ff757869fb8f96d00ec1ccf880def1d00fd6d1f175546/simpl_client-0.7.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8713f6f2c20a00f7d21ced3125d477a0", "sha256": "ed115a0e94529e8ea56c30b2cf5764e06e7ac11d0c5eef026e06975099062080" }, "downloads": -1, "filename": "simpl_client-0.7.3.tar.gz", "has_sig": false, "md5_digest": "8713f6f2c20a00f7d21ced3125d477a0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5239, "upload_time": "2018-09-14T14:59:21", "url": "https://files.pythonhosted.org/packages/f2/c4/e06b890a4b644e3253ca1cf409b6aac891a0c7a3e778e2c0a484d11e29dc/simpl_client-0.7.3.tar.gz" } ], "0.7.4": [ { "comment_text": "", "digests": { "md5": "8daeed3dd1ab248e4295ac988ed19a79", "sha256": "3b53ffb36e706fa20a4eba388ba043da642463047ec82f4b476865c3adbafefb" }, "downloads": -1, "filename": "simpl_client-0.7.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "8daeed3dd1ab248e4295ac988ed19a79", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 6899, "upload_time": "2018-09-21T12:47:07", "url": "https://files.pythonhosted.org/packages/df/1b/2431c602bc3b3a565049984e348eecba94bf519e54b14c2987d8edb2c4c6/simpl_client-0.7.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1bd5f2f4a2f1655af53c3417f2205c54", "sha256": "ebd71c1bb4cd81ad9fb1fc80d836b3f3c990fdd8e4d2100ab80beb7ee3a77fee" }, "downloads": -1, "filename": "simpl_client-0.7.4.tar.gz", "has_sig": false, "md5_digest": "1bd5f2f4a2f1655af53c3417f2205c54", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5449, "upload_time": "2018-09-21T12:47:09", "url": "https://files.pythonhosted.org/packages/e6/74/70df81511f93c15bf799514b4d9179ae488a2a047f06b1685abed67e1ac9/simpl_client-0.7.4.tar.gz" } ], "0.7.5": [ { "comment_text": "", "digests": { "md5": "d5ebf54dc2fb9783ef3f4c17d619d36a", "sha256": "2757e7878063c9ab7ec3e973544cdfaee44cc3ddc58ee2e964f166c675a3c6a0" }, "downloads": -1, "filename": "simpl_client-0.7.5-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "d5ebf54dc2fb9783ef3f4c17d619d36a", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 20335, "upload_time": "2018-12-20T16:17:36", "url": "https://files.pythonhosted.org/packages/b1/96/7815699637c94baf1e22ca86f97c635b7b363f6f52b8534b68a2379d555a/simpl_client-0.7.5-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7bf617351d7ddaee6a7f11e7abb9f141", "sha256": "b0935c3be99db49e0b68337fc8d8f3679d7469149711e5ee6b616ed779bb7869" }, "downloads": -1, "filename": "simpl_client-0.7.5.tar.gz", "has_sig": false, "md5_digest": "7bf617351d7ddaee6a7f11e7abb9f141", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6730, "upload_time": "2018-12-20T16:17:39", "url": "https://files.pythonhosted.org/packages/43/94/3979b481b24cd9fff2dcd0fa432110fa57e9409ea2d65165db423ba8efd7/simpl_client-0.7.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d5ebf54dc2fb9783ef3f4c17d619d36a", "sha256": "2757e7878063c9ab7ec3e973544cdfaee44cc3ddc58ee2e964f166c675a3c6a0" }, "downloads": -1, "filename": "simpl_client-0.7.5-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "d5ebf54dc2fb9783ef3f4c17d619d36a", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 20335, "upload_time": "2018-12-20T16:17:36", "url": "https://files.pythonhosted.org/packages/b1/96/7815699637c94baf1e22ca86f97c635b7b363f6f52b8534b68a2379d555a/simpl_client-0.7.5-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7bf617351d7ddaee6a7f11e7abb9f141", "sha256": "b0935c3be99db49e0b68337fc8d8f3679d7469149711e5ee6b616ed779bb7869" }, "downloads": -1, "filename": "simpl_client-0.7.5.tar.gz", "has_sig": false, "md5_digest": "7bf617351d7ddaee6a7f11e7abb9f141", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6730, "upload_time": "2018-12-20T16:17:39", "url": "https://files.pythonhosted.org/packages/43/94/3979b481b24cd9fff2dcd0fa432110fa57e9409ea2d65165db423ba8efd7/simpl_client-0.7.5.tar.gz" } ] }