turkleton package

Submodules

turkleton.connection module

mturk.connection

Simplified interface for connecting to Mechanical Turk.

exception turkleton.connection.ConnectionError[source]

Bases: turkleton.errors.Error

Error involving the connection to Mechanical Turk

turkleton.connection.get_connection()[source]

Return the Mechanical Turk connection for this process.

Return type:boto.mturk.connection.MTurkConnection
turkleton.connection.set_connection(boto_connection)[source]

Set the Mechanical Turk connection for this process.

Parameters:boto_connection (boto.mturk.connection.MTurkConnection) – A connection
turkleton.connection.setup(access_key_id, secret_access_key, host=None)[source]

Setup the global connection to Mechanical Turk.

Parameters:
  • access_key_id (str or unicode) – The access key id
  • secret_access_key (str or unicode) – The access secret key
  • host (str or unicode) – (Optional, default is production MTurk) The host to connect to
Return type:

boto.mturk.connection.Connection

turkleton.connection.setup_sandbox(access_key_id, secret_access_key)[source]

Setup a global connection to the Mechanical Turk sandbox.

Parameters:
  • access_key_id (str or unicode) – The access key id
  • secret_access_key (str or unicode) – The access secret key
Return type:

boto.mturk.connection.Connection

turkleton.errors module

turkleton.errors

Defines base classes for all errors

exception turkleton.errors.ConnectionError[source]

Bases: turkleton.errors.Error

Error involving a connection to a service

exception turkleton.errors.Error[source]

Bases: exceptions.Exception

Base class for all errors

turkleton.utils module

turkleton.utils

Miscellaneous utility methods

turkleton.utils.safe_getattr(obj, attr_name)[source]

Get the attribute of an object returning None if the attribute does not exist.

Parameters:
  • obj (mixed) – An object
  • attr_name (str or unicode) – The name of the attribute

Module contents