This small library will help you to create and manage your applications in a PyBossa server.
You can install pybossa-client using pip, preferably while working in a virtualenv:
$ pip install pybossa-client
Setup:
import pbclient
# setup the server connection
pbclient.set('endpoint', 'http://pybossa.com')
pbclient.set('api_key', '--your-api-key-here--')
Create an application:
pbclient.create_app('Name of the App', 'shortname', 'Description')
Change the long description of an app:
app = pbclient.find_app(short_name='flickrperson')
app.long_description = open('longdesc.html').read()
pbclient.update_app(app)
Create a new task:
task_info = {
'image': 'http://farm9.staticflickr.com/8146/7566819662_f2c74e77d8_m.jpg'
}
pbclient.create_task(app_id, task_info)
A simple PyBossa client
license: | MIT |
---|
Creates an application
Parameters: |
|
---|---|
Returns: | True – the response status code |
Creates a task for a given application ID
Parameters: |
|
---|---|
Returns: | True – the response status code |
Deletes an Application with id = app_id
Parameters: | app_id (integer) – PyBossa Application ID |
---|---|
Returns: | True – the response status code |
Deletes a task for a given task ID
Parameters: | task – PyBossa task |
---|
Returns a list with matching app arguments
Parameters: | kwargs – PyBossa Application members |
---|---|
Return type: | list |
Returns: | A list of application that match the kwargs |
Returns a list of matched task runs for a given application ID
Parameters: |
|
---|---|
Return type: | list |
Returns: | A List of task runs that match the query members |
Returns a list of matched tasks for a given application ID
Parameters: |
|
---|---|
Return type: | list |
Returns: | A list of tasks that match the kwargs |
Returns a PyBossa Application for the app_id
Parameters: | app_id (integer) – PyBossa Application ID |
---|---|
Return type: | PyBossa Application |
Returns: | A PyBossa Application object |
Returns a list of registered apps
Parameters: |
|
---|---|
Return type: | list |
Returns: | A list of PyBossa Applications |
Returns a list of task runs for a given application ID
Parameters: |
|
---|---|
Return type: | list |
Returns: | A list of task runs for the given application ID |
Returns a list of tasks for a given application ID
Parameters: |
|
---|---|
Returns: | True – the response status code |
Updates an application app instance
Parameters: | app (PyBossa Application) – PyBossa Application |
---|---|
Returns: | True – the response status code |
Updates a task for a given task ID
Parameters: | task – PyBossa task |
---|