{ "info": { "author": "Gameworks", "author_email": "gio@proudcloud.io", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# Gameworks Python SDK\n\n
\n\n[![Pypi Version](https://img.shields.io/pypi/v/gameworks.svg)](https://pypi.python.org/pypi/gameworks)\n[![Build Status](https://circleci.com/gh/gameworks-gwx/gameworks-python-sdk.svg?style=shield&circle-token=a0edd961651da7ec99bdea856ef42bb729f11a0f)](https://circleci.com/gh/gameworks-gwx/gameworks-python-sdk)\n
\n\n## Introduction\n\nA Software Development Kit for serving Gameworks applications and services. The SDK currently allows you to connect to the Gameworks Registry API.\n\n## Features\n\n- Is able to connect to Gameworks services through basic authentication tokens\n- Is able to connect to the Registry API service:\n - User Registration\n - Player Profile Creation\n - Publisher Profile Creation\n\n\n\n## Future Releases\n\n- Will be able to peform NEM blockchain transactions via the Gameworks Cashier API\n- Will be able to connect to Gameworks services through OAuth 2.0 Protocol\n\n\n\n## Installation\n\nTo install Gameworks SDK (stable build), run this command in your terminal:\n\n```shell\n$ pip install gameworks\n```\n\n## Development\n\nCode is hosted at [Gameworks Python SDK Git Repository](https://github.com/gameworks-gwx/gameworks-python-sdk)\n\n```shell\n$ git clone git://github.com/gameworks-gwx/gameworks-python-sdk.git\n$ cd gameworks-python-sdk\n```\n\nSet up a virtual environment to isolate python dependencies.\n\n```shell\n$ virtualenv venv\n$ source venv/bin/activate\n```\n\nInstall development dependencies.\n\n```shell\n$ pip install -r requirements-dev.txt #optional\n```\n\nRun the tests.\n\n```shell\n$ python -m unittest\n```\n\n## Configuration\n\nTo get started, import the gameworks SDK python module.\n\n```python\nimport gameworks\n```\n\nCreate a .env file in your respository to set your environment variables. In this context, the .env file is used to configure two environment variables: authorization key for accessing the API `GAMEWORKS_KEY` and the API environment `GAMEWORKS_ENV` you would like to connect to. There are two environments provisioned for the SDK which are `sandbox` and `live`; by default the SDK points to the sandbox environment. The sandbox environment is used as a playground for development purposes, while the live environment connects to the actual Registry API. \n\n```sh\n$ touch .env\n$ sudo nano .env\n```\n\n### .env \n\n```sh\nexport GAMEWORKS_KEY=\"Authentication Token\"\nexport GAMEWORKS_ENV=\"live\" #sandbox or live\n```\n\nThen, execute commands in the .env file using source\n\n```sh\n$ source .env\n```\n\n## Usage\n\n### Session Module\n\nThis module allows you to **configure** your authentication variables, **register** a user account and **login** using an existing user account. You may choose to login the Registry API using your Gameworks credentials or use an existing JWT access token provided to you when you previously logged in. \n\n\n\n#### Registering a User Account\n\nWhen creating a user, use the wallet address provided by the **Gameworks Mobile Wallet** or a **NEM wallet address.**\n\n```python\nfrom gameworks import Session\n\nresponse = Session.register(\n firstName='Luke',\n lastName='Skywalker',\n walletAddress='TBZMQO7ZPBYNBDUR7F75MAKA2S3DHDCIFG775N3D',\n email='luke@therebellion.io',\n password='nooooooooooo!!!!!!???!?!!!'\n passwordConfirmation='nooooooooooo!!!!!!???!?!!!'\n)\n\n# At this point, the SDK has already thrown an HTTP call to the Registry API.\nprint(response.status_code) #Returns the status code of the response (e.g. 200, 404)\nprint(response.text) #Returns the whole response in text format\n\n```\n\nTake note that **all** **results** are returned as a **Response** object. You may refer to the [requests package response object](http://docs.python-requests.org/en/master/user/quickstart/#response-content).\n\n\n\n#### Login using a User Account\n\nLogging in using a user account, will trigger another token to be created. Tokens **expire within an hour** from the time of creation. \n\n```python\nfrom gameworks import Session\n\nresponse = Session.login(\n email='luke@therebellion.io',\n password='nooooooooooo!!!!!!???!?!!!'\n)\n```\n\n\n\n#### Storing a Token\n\nIf you already have an access token, you may choose to bypass the login process and directly use the functionalities of the Gameworks services. As of the alpha release, the token exported as an environment variable is being used thus there is no need to use this function for authentication.\n\n```python\nfrom gameworks import Session\n\nresponse = Session.store_key(\n key='eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxMTAsImV4cCI6MT...',\n userId=1\n)\n```\n\n------\n\n### Registry Module \n\nThis module allows you create, update and view a **user** account, a **player** profile and a **publisher** account. All functionlaities contained in this module can be supplmented by tokens/keys. You may add them into the parameters in order to manually activate functionalities without having to create the .env file. See the code below as an example:\n\n```python\nfrom gameworks.registry import User\n\nresponse = User.find(\n userId=1,\n key='eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxMTAsImV4cCI6MT...'\n)\n```\n\n\n\n#### User Resource Functionalities\n\n------\n\n#### Find User\n\n* Authentication Token Required \n\nTo retrieve your user's account details, you may choose to query for it using the code below:\n\n```python\nfrom gameworks.registry import User\n\n# You may only use your own user id for this function\nresponse = User.find(userId=1)\n```\n\n\n\n#### Update User\n\n* Authentication Token Required \n\nYou may choose to update specific data in your account information. You don't need to fill up all the parameters in the account information. Updatable account parameters include: `firstName`, `lastName`, `walletAddress` and `pk` (private key associated to the NEM wallet address)\n\n```python\nfrom gameworks.registry import User\n\nresponse = User.update(\n userId=1,\n firstName='Luke',\n lastName='Skywalker',\n walletAddress='TBZMQO7ZPBYNBDUR7F75MAKA2S3DHDCIC3POR2D2',\n pk='woooahtweevwoopvrrruhfdedadahhhhhhhbeepboopdoopwaaaahwoooooaevvr'\n)\n```\n\n\n\n#### Confirm User\n\nOnce you have registered for a user account and have logged in, you will receive a message containg your confirmation code in the email you have provided. Use the code below to confirm your account programatically. You no longer need to input your userId since the Registry API already knows to which account the code is assigned to.\n\n```python\nfrom gameworks.registry import User\n\nresponse = User.confirm(code='R2D2')\n```\n\n\n\n#### Resend Code\n\n* Authentication Token Required \n\nIn the case that your confirmation code hasn't been emailed yet, you may choose to have it resent using the code below:\n\n```python\nfrom gameworks.registry import User\n\nresponse = User.resend_code(userId=1)\n```\n\n\n\n#### Player Profile Resource Functionalities\n\n------\n\n#### Register Player Profile\n\n* Authentication Token Required \n\nCreate a player profile by entering your desired `username` and your `userId` as shown in the code below:\n\n```python\nfrom gameworks.registry import Player\n\nresponse = Player.register(\n userId=1,\n username='JediMasterXIII'\n)\n```\n\n\n\n#### Find Player Profile\n\n* Authentication Token Required \n\nTo retrieve your player profile, query for it using the code below:\n\n```python\nfrom gameworks.registry import Player\n\nresponse = Player.find(\n userId=1\n)\n```\n\n\n\n#### Update Player Profile\n\n* Authentication Token Required \n\nUpdate your `username` by executing the code below:\n\n```python\nfrom gameworks.registry import Player\n\nresponse = Player.update(\n userId=1,\n username='JediMasterXIX'\n)\n```\n\n\n\n#### Publisher Account Resource Functionalities\n\n------\n\n#### Register Publisher Account\n\n* Authentication Token Required \n\nCreate a publisher account by executing the code below:\n\n```python\nfrom gameworks.registry import Player\n\nresponse = Player.register(\n userId=1,\n username='JediMasterXIII'\n)\n```\n\n\n\n#### Find Publisher Profile\n\n* Authentication Token Required \n\nTo retrieve your publisher profile, query for it using the code below:\n\n```python\nfrom gameworks.registry import Player\n\nresponse = Publisher.find(\n userId=1\n)\n```\n\n\n\n#### Update Publisher Profile\n\n* Authentication Token Required \n\nYou may choose to update specific data in your publisher account information. You don't need to fill up all the parameters in the account information. Updatable account parameters include: `userId`, `walletAddress` (wallet address may not be the same as the user account's wallet address), `publisherName `, `description`.\n\n```python\nfrom gameworks.registry import Player\n\nresponse = Publisher.update(\n userId=1,\n publisherName='The Second Order',\n walletAddress='JABBATHEHUTTBDUR7F75MAKA2S3DHDCIC3POR2D2',\n description='Upon the ashes shall arise the Second Order'\n)\n```\n\n## License\n\n```LICENSE\nThe MIT License (MIT)\n\nCopyright (C) 2019 Gameworks.io\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n```\n\n\n\n## Others\n\nEnjoying our platform? Leave us a star on [Github](https://github.com/gameworks-gwx/gameworks-python-sdk) to motivate us to create more services for you ;) .\n\n\n\n\n\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/gameworks-gwx/gameworks-python-sdk", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "gameworks", "package_url": "https://pypi.org/project/gameworks/", "platform": "", "project_url": "https://pypi.org/project/gameworks/", "project_urls": { "Homepage": "https://github.com/gameworks-gwx/gameworks-python-sdk" }, "release_url": "https://pypi.org/project/gameworks/0.2.0/", "requires_dist": [ "requests (==2.21.0)" ], "requires_python": "", "summary": "A Python Rest SDK for Gameworks Services", "version": "0.2.0" }, "last_serial": 5012512, "releases": { "0.1.1": [ { "comment_text": "", "digests": { "md5": "5d4d077e35b2b8d1aa935895113652a6", "sha256": "aff3f18c2f4e38321faa0c53bdc909bb2307be2dac2a3c80f2fd1a0b5965580f" }, "downloads": -1, "filename": "gameworks-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "5d4d077e35b2b8d1aa935895113652a6", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 11345, "upload_time": "2019-03-15T07:39:53", "url": "https://files.pythonhosted.org/packages/34/ff/889c34ea3986dffb3f07e375ab55a1598de7d8bb5f7aa9bd82cdfb51968c/gameworks-0.1.1-py3-none-any.whl" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "2713f8e465e6a490e2449329908be640", "sha256": "4eba13f37d2c7e457f72226ad60b53cc8df8cfb1a02308d46a644cfa70f1db6d" }, "downloads": -1, "filename": "gameworks-0.1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "2713f8e465e6a490e2449329908be640", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 11328, "upload_time": "2019-03-15T08:50:37", "url": "https://files.pythonhosted.org/packages/05/75/8659f121826dcb4ef1e5fc01b0c8a9a52d57c60fb126e5236c2b89c26621/gameworks-0.1.2-py3-none-any.whl" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "a2b413a286d6439466c9caf7d02838ce", "sha256": "7d6def63f503766db301b00e7404240f4f3c55d7ebc823a689d4542069b93c76" }, "downloads": -1, "filename": "gameworks-0.1.3-py3-none-any.whl", "has_sig": false, "md5_digest": "a2b413a286d6439466c9caf7d02838ce", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 11254, "upload_time": "2019-03-15T09:08:32", "url": "https://files.pythonhosted.org/packages/ad/cb/6d09544e6f5ea0770fb6b3c213c1e2a558cdc8ce3bf1d61302bbab4310f5/gameworks-0.1.3-py3-none-any.whl" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "0389ee527b9a6204fb9c1f80d4e22a0d", "sha256": "843ed9754fd89a654f2e227ec4ec479c89b9d3adda9e897efb3fa21d176c5728" }, "downloads": -1, "filename": "gameworks-0.1.4-py3-none-any.whl", "has_sig": false, "md5_digest": "0389ee527b9a6204fb9c1f80d4e22a0d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 11261, "upload_time": "2019-03-15T09:42:13", "url": "https://files.pythonhosted.org/packages/25/bd/d30f74744188198ec799df49dcadf352dd6d11f58810f48f57830c7c6478/gameworks-0.1.4-py3-none-any.whl" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "ad91af08b912114d794618ed082a9e5a", "sha256": "5369a518d2beddc57dce0f5ff47ce7917c4e56f4fa290f0324629967b4bef77c" }, "downloads": -1, "filename": "gameworks-0.1.5-py3-none-any.whl", "has_sig": false, "md5_digest": "ad91af08b912114d794618ed082a9e5a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 11245, "upload_time": "2019-03-15T12:52:34", "url": "https://files.pythonhosted.org/packages/16/c4/7315932c79bb06da4e32934b0485577a3a0d2338a3660864b921be696b4b/gameworks-0.1.5-py3-none-any.whl" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "93842e383cd3fe6a0d623409ab2e5bed", "sha256": "9a66bdfbb07e39854a71eb238362ac7e149b9befbdd01c4869927aa1e8957fc5" }, "downloads": -1, "filename": "gameworks-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "93842e383cd3fe6a0d623409ab2e5bed", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 11246, "upload_time": "2019-04-01T10:44:11", "url": "https://files.pythonhosted.org/packages/53/c0/e7278fc27cdc5a08056ff4e37106d82edaf2c57aa73c3120e6120a9a6196/gameworks-0.2.0-py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "93842e383cd3fe6a0d623409ab2e5bed", "sha256": "9a66bdfbb07e39854a71eb238362ac7e149b9befbdd01c4869927aa1e8957fc5" }, "downloads": -1, "filename": "gameworks-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "93842e383cd3fe6a0d623409ab2e5bed", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 11246, "upload_time": "2019-04-01T10:44:11", "url": "https://files.pythonhosted.org/packages/53/c0/e7278fc27cdc5a08056ff4e37106d82edaf2c57aa73c3120e6120a9a6196/gameworks-0.2.0-py3-none-any.whl" } ] }