{ "info": { "author": "Amazon Mechanical Turk", "author_email": "mturk-requester-preview@amazon.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3" ], "description": "Prerequisites\n-------------\nTo use this library, you'll need first follow our `account set-up instructions`_\nto set up your Mechanical Turk and AWS accounts to call the API.\n\nInstantiating the client requires using a Session object from boto3 to\nauthenticate. The `boto3 docs`_ describe how to manage your credentials in more\ndetail.\n\n.. _`account set-up instructions`: https://blog.mturk.com/setting-up-your-mechanical-turk-and-aws-accounts-to-call-the-sentiment-analysis-api-bd4e2a034c5\n.. _`boto3 docs`: http://boto3.readthedocs.io/en/latest/guide/configuration.html\n\nQuick Start\n-----------\nFirst, install the library:\n\n.. code-block:: sh\n\n $ pip install mturk-crowd-beta-client\n\nThen, from a Python interpreter or script, create your first task:\n\n.. code-block:: python\n\n from mturk_crowd_beta_client import MTurkCrowdClient\n from boto3.session import Session\n import uuid\n\n # This examples assume you have a local AWS profile called\n # 'mturk-crowd-caller', but you can authenticate however you like,\n # including by directly passing in your access key and secret key.\n session = Session(profile_name='mturk-crowd-caller')\n\n # Create the client\n crowd_client = MTurkCrowdClient(session)\n\n # For this example, we'll give our task a random, unique name. For real\n # work, you'll probably want to pick a name based on your input source.\n task_name = 'my-test-task-' + uuid.uuid4().hex\n function_name = 'sentiment-analysis-test'\n\n # Create the task\n put_result = crowd_client.put_task(function_name,\n task_name,\n {'text': 'Everything is wonderful.'})\n print('PUT response: {}'.format(\n {'status_code': put_result.status_code, 'task': put_result.json()}))\n # => PUT response: {\n # 'status_code': 201,\n # 'task': {'input': {'text': 'Everything is wonderful.'},\n # 'problemDetails': None,\n # 'result': None,\n # 'state': 'processing',\n # 'taskName': 'my-test-task-73fbfb29f2bc451d9696d11103dcaf0e'}\n # }\n\n # Get the task we just created. Note that for a production (i.e., non-test)\n # task, we'd have to poll periodically until the task completed.\n get_result = crowd_client.get_task(function_name, task_name)\n print('GET response: {}'.format(\n {'status_code': get_result.status_code, 'task': get_result.json()}))\n # => GET response: {\n # 'status_code': 200,\n # 'task': {'input': {'text': 'Everything is wonderful.'},\n # 'problemDetails': None,\n # 'result': {'sentiment': 'positive'}\n # 'state': 'completed',\n # 'taskName': 'my-test-task-73fbfb29f2bc451d9696d11103dcaf0e'}\n # }\n\nFurther Reading\n---------------\n\nCheck out our `usage instructions`_ and `API documentation`_ for more details\nabout how to use the API and this client.\n\n.. _`usage instructions`: https://medium.com/@mechanicalturk/instructions-for-calling-our-new-sentiment-analysis-api-21986c2cdff0\n.. _`API documentation`: https://medium.com/@mechanicalturk/mechanical-turk-sentiment-analysis-api-documentation-e0ab8279a70a\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/awslabs/mturk-crowd-beta-client-python", "keywords": "mturk-crowd-beta-client", "license": "Apache License 2.0", "maintainer": "", "maintainer_email": "", "name": "mturk-crowd-beta-client", "package_url": "https://pypi.org/project/mturk-crowd-beta-client/", "platform": "", "project_url": "https://pypi.org/project/mturk-crowd-beta-client/", "project_urls": { "Homepage": "https://github.com/awslabs/mturk-crowd-beta-client-python" }, "release_url": "https://pypi.org/project/mturk-crowd-beta-client/1.0.0/", "requires_dist": null, "requires_python": "", "summary": "A client for the MTurk Crowd REST API", "version": "1.0.0" }, "last_serial": 3152052, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "e543d6a248b740e9d33e51297ccaf999", "sha256": "cee8b155225fae8b2397926bd3062c15b1cd38863c5bdcfddabfa4337439a558" }, "downloads": -1, "filename": "mturk-crowd-beta-client-1.0.0.tar.gz", "has_sig": true, "md5_digest": "e543d6a248b740e9d33e51297ccaf999", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4911, "upload_time": "2017-09-06T01:50:49", "url": "https://files.pythonhosted.org/packages/0b/73/c3922c26604d0d0748ac0634f2a9bcb10c5d2a2e9d2dc0476ddb27c22467/mturk-crowd-beta-client-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e543d6a248b740e9d33e51297ccaf999", "sha256": "cee8b155225fae8b2397926bd3062c15b1cd38863c5bdcfddabfa4337439a558" }, "downloads": -1, "filename": "mturk-crowd-beta-client-1.0.0.tar.gz", "has_sig": true, "md5_digest": "e543d6a248b740e9d33e51297ccaf999", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4911, "upload_time": "2017-09-06T01:50:49", "url": "https://files.pythonhosted.org/packages/0b/73/c3922c26604d0d0748ac0634f2a9bcb10c5d2a2e9d2dc0476ddb27c22467/mturk-crowd-beta-client-1.0.0.tar.gz" } ] }