Skip to main content

A simple server and script for rapidly prototyping Mechanical Turk interfaces.

prototurk server

The ProtoTurk package provides prototurk, a Bottle-based webserver for rapidly prototyping Mechanical Turk interfaces. prototurk takes Mechanical-Turk compatible HTML templates and CSV files as arguments:

prototurk [--host hostname] [--port port_number] html_file csv_file

and starts a webserver that, by default, listens on localhost port 8080. prototurk re-reads the HTML template and CSV file from disk with every page refresh. When a user submits the HTML template’s form, the form parameters are logged to stdout.

prototurk does not save any data to database or disk. If you need to run a Mechanical Turk-style server in your Local Environment, please take a look at Turkle.

prototurk-populate script

The ProtoTurk package also includes prototurk-populate, a simple script that takes as arguments the path to a Mechanical-Turk compatible HTML template, the path to a CSV file, and the (1-indexed) row number for the data to use from the CSV file:

prototurk-populate [--output-file OUTPUT_FILE] html_file csv_file csv_row_number

The script outputs a populated HTML template, where the template variables have been replaced with values from the row of the CSV file. By default, prototurk-populate writes the populated HTML template to stdout, but the --output-file flag can alternately be used to write the populated output directly to a (UTF-8 encoded) file.

prototurk-populate makes it easier to validate Mechanical Turk template files using HTML and JavaScript validation tools. Most popular HTML/JavaScript will generate errors about Mechanical Turk-style template variables. prototurk-populate makes it easier to validate populated templates with real data, particularly as part of Continuous Integration workflows.

Installation

ProtoTurk can be installed using:

python setup.py install

Or from PyPI:

pip install prototurk

Metadata

Release files for prototurk 0.4.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 prototurk 0.4.2
File Size Uploaded
prototurk-0.4.2.tar.gz 137.1 kB Details

Release files / prototurk-0.4.2.tar.gz

Download URL prototurk-0.4.2.tar.gz
Size 137.1 kB
Tags Source
SHA-256 checksum
How to use checksums
ea06f1f1619d9a479bc29de837fc00878a03b35035047dcd56f0b5429ee80460
BLAKE2b-256 checksum
How to use checksums
5163f78144f68a6e8aca53e0f8821b9fafa87b8fda94047c0896083e728b6714
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.7.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.8.5

Release history Release notifications | RSS feed

This release

0.4.2 This release

1 release file

0.4.1

1 release file

0.4.0

1 release file

0.3.3

1 release file

0.3.2

1 release file

0.3.1

1 release file

0.3.0

1 release file

0.2.3

1 release file

0.2.2

1 release file

0.2.1

1 release file

0.2.0

1 release file

0.1.1

1 release file

0.1.0

1 release file

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