{ "info": { "author": "Eric Scrivner", "author_email": "eric.t.scrivner@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Natural Language :: English", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4" ], "description": "===============================\nturkleton\n===============================\n\n.. image:: https://img.shields.io/travis/etscrivner/turkleton.svg\n :target: https://travis-ci.org/etscrivner/turkleton\n\n.. image:: https://coveralls.io/repos/etscrivner/turkleton/badge.svg?branch=master\n :target: https://coveralls.io/r/etscrivner/turkleton?branch=master\n\n\n.. image:: https://img.shields.io/pypi/v/turkleton.svg\n :target: https://pypi.python.org/pypi/turkleton\n\n.. image:: https://readthedocs.org/projects/turkleton/badge/?version=latest\n :target: https://readthedocs.org/projects/turkleton/?badge=latest\n :alt: Documentation Status\n\nDead simple Python interfaces for Amazon Mechanical Turk.\n\n* Free software: BSD license\n* Documentation: https://turkleton.readthedocs.org.\n\nInstallation\n------------\n\nSimply use pip to download the package from PyPI\n\n.. code-block:: shell\n\n $ pip install turkleton\n\nFeatures\n--------\n\nThe existing Python APIs for Mechanical Turk are thin wrappers at best - we can\ndo better.\n\nTurkleton aims to leverage the expressive powers of Python to improve the whole\nsituation. While still under active development, the main features are:\n\n* Simple interface for defining tasks from pre-built layouts.\n* Simple interface for defining schema of assignment results.\n* Easily upload tasks in batches.\n* Easily download and validate assignments.\n\nExamples\n--------\n\nIn turkleton there are several objects to be aware of: Tasks, HITs, and\nAssignments. A Task is a template from which HITs are created. A HIT\ncorresponds to HIT in the Amazon Mechanical Turk API and represents an uploaded\nTask. Assignments are contained within HITs. An individual Assignment\nrepresents the set of answers submitted by a single worker. A HIT can have many\nAssignments.\n\nSetting Up Your Connection\n^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nTurkleton uses a per-process global connection. It should be initialized before\nyou attempt to upload or download anything. You can initialize it like so:\n\n.. code-block:: python\n\n from turkleton import connection\n connection.setup(AWS_ACCESS_KEY, AWS_SECRET_ACCESS_KEY)\n\nThat's it!\n\nCreating A Task And Uploading It\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nTo define a HIT you create a Task representing the template of the assignment\nyou want a worker to complete. For example:\n\n.. code-block:: python\n\n import datetime\n\n from turkleton.assignment import task\n \n class MyTask(task.BaseTask):\n __layout_id__ = 'MY LAYOUT ID'\n __reward__ = 0.25\n __title__ = 'Guess How Old From Picture'\n __description__ = 'Look at a picture and guess how old the person is.'\n __keywords__ = ['image', 'categorization']\n __time_per_assignment__ = datetime.timedelta(minutes=5)\n\nHere we've created a Task from an existing layout. Now that we've defined our\ntask we can easily upload HITs by filling out the layout parameters:\n\n.. code-block:: python\n\n task = MyTask(image_url='http://test.com/img.png', first_guess='29')\n hit = task.upload(batch_id='1234')\n\nThis will create a new assignment from the task template and upload it to\nMechanical Turk. The optional batch_id parameter allows you to set the\nannotation for the task to an arbitrary string that you can use to retrieve\ntasks later in batches.\n\nYou can upload many tasks in a loop easily as follows:\n\n.. code-block:: python\n\n for image_url in all_image_urls:\n MyTask.create_and_upload(\n image_url=image_url, first_guess='29', batch_id='1234'\n )\n\nIf you'd like to leave off the batch id you can also use the context manager:\n\n.. code-block:: python\n\n with task.batched_upload(batch_id='1234')\n for image_url in all_image_urls:\n MyTask.create_and_upload(image_url=image_url, first_guess='29')\n\nDownloading The Results\n^^^^^^^^^^^^^^^^^^^^^^^\n\nTo download results for a HIT you first need to define an assignment. The\nassignment defines what values are expected and their types. These are used to\nautomatically parse answers to the various questions:\n\n.. code-block:: python\n\n from turkleton.assignment import assignment\n from turkleton.assignment import answers\n \n class MyAssignment(assignment.BaseAssignment):\n categories = answers.MultiChoiceAnswer(question_name='Categories')\n notes = answers.TextAnswer(question_name='AdditionalNotes', default='')\n does_not_match_any = answers.BooleanAnswer(\n question_name='DoesNotMatchAnyCategories', default=False\n )\n\nYou can then download all of the HITs in a given batch as follows:\n\n.. code-block:: python\n\n from turkleton.assignment import hit\n reviewable_hits = hit.get_reviewable_by_batch_id('1234')\n\nEach HIT may then have multiple assignments associated with it. You can\ndownload the assignments, review them, and then dispose of the HIT as follows:\n\n.. code-block:: python\n\n for each in MyAssignment.get_by_hit_id(hit.hit_id):\n print('{} - {} - {}'.format(each.categories, each.notes, each.does_not_match_any))\n if is_valid_assignment(each):\n each.accept('Good job!')\n else:\n each.reject('Assignment does not follow instructions.')\n hit.dispose()\n\n\n\n\nHistory\n-------\n\n1.2.1 (2015-06-15)\n---------------------\n\n* Bugfix, error when retrieving hits by batch id\n\n1.2.0 (2015-06-11)\n---------------------\n\n* More answer types\n* Bugfix where answers retained single value\n\n1.1.0 (2015-06-06)\n---------------------\n\n* Improvements to connection management\n* More convenient syntax for uploading batches\n\n1.0.0 (2015-06-05)\n---------------------\n\n* Major version revisions and updates\n\n0.1.0 (2015-01-11)\n---------------------\n\n* First release on PyPI.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/etscrivner/turkleton", "keywords": "turkleton", "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "turkleton", "package_url": "https://pypi.org/project/turkleton/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/turkleton/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/etscrivner/turkleton" }, "release_url": "https://pypi.org/project/turkleton/1.2.1/", "requires_dist": null, "requires_python": null, "summary": "Simplified interfaces for assignments on Mechanical Turk.", "version": "1.2.1" }, "last_serial": 1593172, "releases": { "0.1.1": [ { "comment_text": "", "digests": { "md5": "74a217ad8a1bc4d8ebf7aded6a3e079a", "sha256": "1fa954c905d6abcc7f95d3c0ced6ada601ee0e468c43b33bf7046db2a4e8ecdb" }, "downloads": -1, "filename": "turkleton-0.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "74a217ad8a1bc4d8ebf7aded6a3e079a", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 6623, "upload_time": "2015-06-02T22:32:52", "url": "https://files.pythonhosted.org/packages/a0/3b/ba0ff91f4c87b4115feaed65d2755f804882ec957e32800868a46841662d/turkleton-0.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6bf155e57f37f68377c3f7fe7d5a9f8d", "sha256": "8a790b27b04cd8e32f31e0180d2c132b6e41567746f8054a4e3031d9bac57080" }, "downloads": -1, "filename": "turkleton-0.1.1.tar.gz", "has_sig": false, "md5_digest": "6bf155e57f37f68377c3f7fe7d5a9f8d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15162, "upload_time": "2015-06-02T22:32:49", "url": "https://files.pythonhosted.org/packages/56/b0/b51ac7c3173db827b9c3786fb3abda430c98c411bb7ca4bdce59c5d7702c/turkleton-0.1.1.tar.gz" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "9576b994e5e44b80bc155867772872f2", "sha256": "3a035a30ada17867dabbc0f3b7fc06c652337b61f7529bd7d52b20087bb0daff" }, "downloads": -1, "filename": "turkleton-1.0.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "9576b994e5e44b80bc155867772872f2", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 12349, "upload_time": "2015-06-05T18:55:11", "url": "https://files.pythonhosted.org/packages/d5/fa/e4c269c785e21be7889d7aeffdcb58e5cd7dec0911a124c22279d45d6092/turkleton-1.0.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c230c3a3f2a18b96cc38e5b16ede56fa", "sha256": "dd30f5cdaeb7ebf6e2d127ada25c7bc269a639e7c12fa9342e7c192713898d7a" }, "downloads": -1, "filename": "turkleton-1.0.0.tar.gz", "has_sig": false, "md5_digest": "c230c3a3f2a18b96cc38e5b16ede56fa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21953, "upload_time": "2015-06-05T18:55:07", "url": "https://files.pythonhosted.org/packages/c2/11/33556c14953c912bd0a9316bf559c6bdf2206cbd55c3e66e3420dac10db6/turkleton-1.0.0.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "2656868d941e34b1326844087caee780", "sha256": "40c95e81452ab417cc67fbfe0878cfd767d4c24cc60798c34c6301e3be9f1658" }, "downloads": -1, "filename": "turkleton-1.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "2656868d941e34b1326844087caee780", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 13398, "upload_time": "2015-06-06T03:22:30", "url": "https://files.pythonhosted.org/packages/8a/6d/4ce9deb4e5ee6c9c9186039d84aa0c6358023fb04029574c1f872ec5b0a0/turkleton-1.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e44515cc787c2e9969b3c3232377897c", "sha256": "5df6a00554d066e5c69510735d4bc7535f385a973a7d403176abf85ce038edac" }, "downloads": -1, "filename": "turkleton-1.1.0.tar.gz", "has_sig": false, "md5_digest": "e44515cc787c2e9969b3c3232377897c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23093, "upload_time": "2015-06-06T03:22:26", "url": "https://files.pythonhosted.org/packages/bc/b0/3b3cfbef4a68bd3cce057b82575be11bee08fa1565e7e8fd3afc5833d788/turkleton-1.1.0.tar.gz" } ], "1.2.0": [ { "comment_text": "", "digests": { "md5": "aafaca1db95584fe8b8e7eae7f3b7e9a", "sha256": "20f86d1d8f5a8841a4865d23d73ea036ef73bcb2a025d1d0c08226c5bea08c1c" }, "downloads": -1, "filename": "turkleton-1.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "aafaca1db95584fe8b8e7eae7f3b7e9a", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 13767, "upload_time": "2015-06-11T21:21:41", "url": "https://files.pythonhosted.org/packages/b8/fb/b68bcc7b31620cb256d3c3cf95bc705e4676d8d2b430209edd269397096b/turkleton-1.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8180b619673ccbf17e012f61aa04601a", "sha256": "bb55a6bc252cbd3ba58231fdbee9d9fd79b2f4ab03213013cac60d65deacec78" }, "downloads": -1, "filename": "turkleton-1.2.0.tar.gz", "has_sig": false, "md5_digest": "8180b619673ccbf17e012f61aa04601a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23815, "upload_time": "2015-06-11T21:21:36", "url": "https://files.pythonhosted.org/packages/25/c1/b5dda1a9d10980bee9403869e72222295fd80209f88fbe74bed0472c1c79/turkleton-1.2.0.tar.gz" } ], "1.2.1": [ { "comment_text": "", "digests": { "md5": "49a17d277a5ebb060d2e6260e6fb4950", "sha256": "0218ab16a1c3677d2e33de90db85eedcd9ddb5a37ef0e8c7e74b387f6f1a0827" }, "downloads": -1, "filename": "turkleton-1.2.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "49a17d277a5ebb060d2e6260e6fb4950", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 13814, "upload_time": "2015-06-15T18:55:42", "url": "https://files.pythonhosted.org/packages/1a/50/fda8bafac681e139c8d29ecc15a8db53a64cad336e77a52a52c434d56b8a/turkleton-1.2.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "850c29aee5da8d53edfa5337d70d3d7b", "sha256": "29a634ad943e8e404f90cb669685b02c697b9652f5c99200d4da3b05969fde05" }, "downloads": -1, "filename": "turkleton-1.2.1.tar.gz", "has_sig": false, "md5_digest": "850c29aee5da8d53edfa5337d70d3d7b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23858, "upload_time": "2015-06-15T18:55:38", "url": "https://files.pythonhosted.org/packages/f0/4e/49052224e9798853446651229f53d667f872b3740ef616c30a9787d4f31c/turkleton-1.2.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "49a17d277a5ebb060d2e6260e6fb4950", "sha256": "0218ab16a1c3677d2e33de90db85eedcd9ddb5a37ef0e8c7e74b387f6f1a0827" }, "downloads": -1, "filename": "turkleton-1.2.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "49a17d277a5ebb060d2e6260e6fb4950", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 13814, "upload_time": "2015-06-15T18:55:42", "url": "https://files.pythonhosted.org/packages/1a/50/fda8bafac681e139c8d29ecc15a8db53a64cad336e77a52a52c434d56b8a/turkleton-1.2.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "850c29aee5da8d53edfa5337d70d3d7b", "sha256": "29a634ad943e8e404f90cb669685b02c697b9652f5c99200d4da3b05969fde05" }, "downloads": -1, "filename": "turkleton-1.2.1.tar.gz", "has_sig": false, "md5_digest": "850c29aee5da8d53edfa5337d70d3d7b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23858, "upload_time": "2015-06-15T18:55:38", "url": "https://files.pythonhosted.org/packages/f0/4e/49052224e9798853446651229f53d667f872b3740ef616c30a9787d4f31c/turkleton-1.2.1.tar.gz" } ] }