Skip to main content

Crowdflower API - Python Client

Project description

Minimal client library for interacting with the CrowdFlower API with Python.

Installation

Install from github at this point:

git clone https://github.com/chbrown/crowdflower.git
cd crowdflower
python setup.py develop

Example use

Import:

import crowdflower

CrowdFlower API keys are 20 characters long; the one below is just random characters.

conn = crowdflower.Connection('LbcxvIlE3x1M8F6TT5hN')

This library will default to an environment variable called CROWDFLOWER_API_KEY if none is specified here:

conn = crowdflower.Connection()

Loop through all your jobs and print the titles:

for job in conn.jobs():
    print job['title']

Create a new job with some new units:

job = conn.upload(data)
print job

Fancy stuff

Run a bunch of DELETE calls on each item in the job.

for delete_response in job.clear_units():
    print delete_response

If you don’t want to print the responses, you still need to exhaust the loop:

list(job.clear_units())

License

Copyright © 2014 Christopher Brown. MIT Licensed.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

crowdflower-0.0.2.tar.gz (4.7 kB view details)

Uploaded Source

File details

Details for the file crowdflower-0.0.2.tar.gz.

File metadata

  • Download URL: crowdflower-0.0.2.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for crowdflower-0.0.2.tar.gz
Algorithm Hash digest
SHA256 de1e8e2f6d805bb561a910b9ddaeb55d22a6079cd2988361a9fbd1596b98b77c
MD5 bb22b42933fa67cd6ed98f670e326a25
BLAKE2b-256 268746cf25019148a553ed15f83800096e1cb71536f7b76b0ad3ee479ec55534

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page