Skip to main content
turkflow
========

Library for quickly creating Mechanical Turk workflows. In some ways, turkflow ended up being an accidental re-implementation of [TurKit](http://dl.acm.org/citation.cfm?id=1866029.1866040&coll=DL&dl=GUIDE&CFID=308021477&CFTOKEN=94691217).

``turkflow`` allows you to specify arbitrary HTML HITs in [jinja2](http://jinja.pocoo.org/docs/) template files and python objects. It also provides functionality for waiting on the results of those HITs, checking HITs previously created by ``turkflow`` for completion, and parsing the results into a python structure.

## Installation
The recommended way to install ``turkflow`` is with ``pip``:

pip install turkflow

You also need to create a [boto configuration file](https://code.google.com/p/boto/wiki/BotoConfig) with your Amazon AWS information.

## Usage

Here is a minimal example of a ``turkflow`` program:

```python
from turkflow.turkflow import *
from jinja2 import *

# create jinja2 environment using "templates" subdirectory
env = Environment(loader=PackageLoader('turkflow', 'templates'))

class TestHIT(TurkHITType):
def __init__(self):
TurkHITType.__init__(self,
"This is a test HIT",
string.split('keywords'),
description = 'test description',
duration = 600, # seconds
max_assignments = 50,
annotation = 'test', # by default, this will make turkflow look for a "test.html" jinja2 template
reward = 0.05,
env = env)

tc = TurkConnection("turkflow_test_id", "~/scratch")
hit_key = tc.createHIT(TestHIT())
results, completion_times = tc.waitForHIT(hit_key, timeout=30) # stop polling after 30 seconds
```

In a 'templates' subdirectory, we include ``base.html`` included in the turkflow repository and our own html file, ``test.html``:

```html
{% extends "base.html" %}

{% block question_content %}
<p id="name_q">What is your name?</p>
<!-- turk questions are identified by "name" so that you can gather multiple responses to the same question -->
<input type="text" name="name_q" placeholder="Clara">
{% endblock %}
```

Metadata

Release files for turkflow 0.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for turkflow 0.2.2
File Size Uploaded Provenance
turkflow-0.2.2.tar.gz 20.4 kB Without provenance Details

Release files / turkflow-0.2.2.tar.gz

Download URL turkflow-0.2.2.tar.gz
Size 20.4 kB
Tags Source
SHA-256 checksum
How to use checksums
2b98bf3e72f821b6aca840ab23895327a2007637b83cc4c36c1712c7d564fbf4
BLAKE2b-256 checksum
How to use checksums
e8c2b7adc2729880c24f13ccd0026bd52da4ed53d8ffacdc47dc56815cd9d653
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for turkflow 0.2.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page