Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Dead simple Python client for PyBossa
Python
branch: master
Failed to load latest commit information.
docs New version and docs
pbclient Fix.
test Include error 400.
.gitignore Ignore .noseids
.travis.yml Improvements.
README.rst Update app -> project in readme
requirements.txt Add requirements for Travis testing
setup.cfg Improvements.
setup.py Increase version.

README.rst

https://travis-ci.org/PyBossa/pybossa-client.png

Dead simple Python client for PyBossa

Makes it easy to work with PyBossa

Install

You can install pybossa-client using pip, preferably while working in a virtualenv:

$ pip install pybossa-client

Usage

Setup:

import pbclient

# setup the server connection
pbclient.set('endpoint', 'http://pybossa.com')
pbclient.set('api_key', '--your-api-key-here--')

Create an project:

pbclient.create_project('Name of the Project', 'shortname', 'Description')

Change the long description of a project:

project = pbclient.find_project(short_name='flickrperson')[0]
project.long_description = open('longdesc.html').read()

pbclient.update_project(project)

Replace the task presenter template:

project = pbclient.find_project(short_name='flickrperson')[0]
project.info['task_presenter'] = open('presenter.html').read()

pbclient.update_project(project)

Create a new task:

task_info = {
    'image': 'http://farm9.staticflickr.com/8146/7566819662_f2c74e77d8_m.jpg'
}
pbclient.create_task(project_id, task_info)

Note: Categories actions POST, PUT and DELETE are only authorized to admin users.

Something went wrong with that request. Please try again.