Class to extract an Assignment structure from a response (used in ResultSet)
Will have attributes named as per the Developer Guide, e.g. AssignmentId, WorkerId, HITId, Answer, etc
Base class to automatically add attributes when parsing XML
Class to extract a HIT structure from a response (used in ResultSet)
Will have attributes named as per the Developer Guide, e.g. HITId, HITTypeId, CreationTime
Has this HIT expired yet?
Class to extract an HITTypeId structure from a response
Block a worker from working on my tasks.
Change the HIT type of an existing HIT. Note that the reward associated with the new HIT type must match the reward of the current HIT type in order for the operation to be valid.
Creates a new HIT. Returns a ResultSet See: http://docs.amazonwebservices.com/AWSMechTurk/2012-03-25/AWSMturkAPI/ApiReference_CreateHITOperation.html
Create a new Qualification Type.
description: description shown to workers. Max 2000 characters.
status: ‘Active’ or ‘Inactive’
test: a QuestionForm
test_duration: the number of seconds a worker has to complete the test.
auto_granted_value: auto_granted qualifications are given this value.
Remove a HIT from the Mechanical Turk marketplace, approves all submitted assignments that have not already been approved or rejected, and disposes of the HIT and all assignment data.
Assignments for the HIT that have already been submitted, but not yet approved or rejected, will be automatically approved. Assignments in progress at the time of the call to DisableHIT will be approved once the assignments are submitted. You will be charged for approval of these assignments. DisableHIT completely disposes of the HIT and all submitted assignment data. Assignment results data cannot be retrieved for a HIT that has been disposed.
It is not possible to re-enable a HIT once it has been disabled. To make the work from a disabled HIT available again, create a new HIT.
Dispose of a HIT that is no longer needed.
Only HITs in the “reviewable” state, with all submitted assignments approved or rejected, can be disposed. A Requester can call GetReviewableHITs to determine which HITs are reviewable, then call GetAssignmentsForHIT to retrieve the assignments. Disposing of a HIT removes the HIT from the results of a call to GetReviewableHITs.
Expire a HIT that is no longer needed.
The effect is identical to the HIT expiring on its own. The HIT no longer appears on the Mechanical Turk web site, and no new Workers are allowed to accept the HIT. Workers who have accepted the HIT prior to expiration are allowed to complete it or return it, or allow the assignment duration to elapse (abandon the HIT). Once all remaining assignments have been submitted, the expired HIT becomes”reviewable”, and will be returned by a call to GetReviewableHITs.
Increase the maximum number of assignments, or extend the expiration date, of an existing HIT.
NOTE: If a HIT has a status of Reviewable and the HIT is extended to make it Available, the HIT will not be returned by GetReviewableHITs, and its submitted assignments will not be returned by GetAssignmentsForHIT, until the HIT is Reviewable again. Assignment auto-approval will still happen on its original schedule, even if the HIT has been extended. Be sure to retrieve and approve (or reject) submitted assignments before extending the HIT, if so desired.
Return all of a Requester’s HITs
Despite what search_hits says, it does not return all hits, but instead returns a page of hits. This method will pull the hits from the server 100 at a time, but will yield the results iteratively, so subsequent requests are made on demand.
Retrieves an assignment using the assignment’s ID. Requesters can only retrieve their own assignments, and only assignments whose related HIT has not been disposed.
The returned ResultSet will have the following attributes:
Retrieves completed assignments for a HIT. Use this operation to retrieve the results for a HIT.
The returned ResultSet will have the following attributes:
The ResultSet will contain zero or more Assignment objects
Return information about the Mechanical Turk Service operations and response group NOTE - this is basically useless as it just returns the URL of the documentation
help_type: either ‘Operation’ or ‘ResponseGroup’
Returns a comma+space-separated string of keywords from either a list or a string
Returns a Price data structure from either a float or a Price
Retrieve the HITs that have a status of Reviewable, or HITs that have a status of Reviewing, and that belong to the Requester calling the operation.
Issues a payment of money from your account to a Worker. To be eligible for a bonus, the Worker must have submitted results for one of your HITs, and have had those results approved or rejected. This payment happens separately from the reward you pay to the Worker when you approve the Worker’s assignment. The Bonus must be passed in as an instance of the Price object.
Send a text message to workers.
Register a new HIT Type title, description are strings reward is a Price object duration can be a timedelta, or an object castable to an int
Return a page of a Requester’s HITs, on behalf of the Requester. The operation returns HITs of any status, except for HITs that have been disposed with the DisposeHIT operation. Note: The SearchHITs operation does not accept any search parameters that filter the results.
Performs a SendTestEventNotification operation with REST notification for a specified HIT type
Performs a SetHITTypeNotification operation to set email notification for a specified HIT type
Performs a SetHITTypeNotification operation to set REST notification for a specified HIT type
Update a HIT with a status of Reviewable to have a status of Reviewing, or reverts a Reviewing HIT back to the Reviewable status.
Only HITs with a status of Reviewable can be updated with a status of Reviewing. Similarly, only Reviewing HITs can be reverted back to a status of Reviewable.
Performs a SetHITTypeNotification operation so set SQS notification for a specified HIT type. Queue URL is of form: https://queue.amazonaws.com/<CUSTOMER_ID>/<QUEUE_NAME> and can be found when looking at the details for a Queue in the AWS Console
Unblock a worker from working on my tasks.
Error for MTurk Requests
Class to extract an Qualification structure from a response (used in ResultSet)
Will have attributes named as per the Developer Guide such as QualificationTypeId, IntegerValue. Does not seem to contain GrantTime.
Class to extract an QualificationRequest structure from a response (used in ResultSet)
Will have attributes named as per the Developer Guide, e.g. QualificationRequestId, QualificationTypeId, SubjectId, etc
Class to extract an QualificationType structure from a response (used in ResultSet)
Will have attributes named as per the Developer Guide, e.g. QualificationTypeId, CreationTime, Name, etc
Class to extract Answers from inside the embedded XML QuestionFormAnswers element inside the Answer element which is part of the Assignment and QualificationRequest structures
A QuestionFormAnswers element contains an Answer element for each question in the HIT or Qualification test for which the Worker provided an answer. Each Answer contains a QuestionIdentifier element whose value corresponds to the QuestionIdentifier of a Question in the QuestionForm. See the QuestionForm data structure for more information about questions and answer specifications.
If the question expects a free-text answer, the Answer element contains a FreeText element. This element contains the Worker’s answer
NOTE - currently really only supports free-text and selection answers
Representation of a single HIT layout parameter
Provides NotificationMessage and Event classes, with utility methods, for implementations of the Mechanical Turk Notification API.
Constructor; expects parameter d to be a dict of string parameters from a REST transport notification message
Verifies the authenticity of a notification message.
Requires workers to acknowledge that they are over 18 and that they agree to work on potentially offensive content. The value type is boolean, 1 (required), 0 (not required, the default).
A Qualification requirement based on the Worker’s location. The Worker’s location is specified by the Worker to Mechanical Turk when the Worker creates his account.
Specifies the total number of HITs submitted by a Worker that have been approved. The value is an integer greater than or equal to 0.
The percentage of assignments the Worker has abandoned (allowed the deadline to elapse), over all assignments the Worker has accepted. The value is an integer between 0 and 100.
The percentage of assignments the Worker has submitted that were subsequently approved by the Requester, over all assignments the Worker has submitted. The value is an integer between 0 and 100.
The percentage of assignments the Worker has submitted that were subsequently rejected by the Requester, over all assignments the Worker has submitted. The value is an integer between 0 and 100.
The percentage of assignments the Worker has returned, over all assignments the Worker has accepted. The value is an integer between 0 and 100.
The percentage of assignments the Worker has submitted, over all assignments the Worker has accepted. The value is an integer between 0 and 100.
An object for constructing an External Question.
A bulleted list suitable for OrderedContent or Overview content
From the AMT API docs:
The top-most element of the QuestionForm data structure is a QuestionForm element. This element contains optional Overview elements and one or more Question elements. There can be any number of these two element types listed in any order. The following example structure has an Overview element and a Question element followed by a second Overview element and Question element–all within the same QuestionForm.
<QuestionForm xmlns="[the QuestionForm schema URL]"> <Overview> [...] </Overview> <Question> [...] </Question> <Overview> [...] </Overview> <Question> [...] </Question> [...] </QuestionForm>
QuestionForm is implemented as a list, so to construct a QuestionForm, simply append Questions and Overviews (with at least one Question).
A class to generate SelectionAnswer XML data structures. Does not yet implement Binary selection options.
A Simple name/value pair that can be easily rendered as XML.
>>> SimpleField('Text', 'A text string').get_as_xml() '<Text>A text string</Text>'