Skip to main content

PyBossa command line client

Project description

Travis CI Coverage Status Downloads License

PBS - a PyBossa command line interface

pbs is a very simple command line interface to a PyBossa server. It allows you to create projects, add tasks (from a CSV or JSON file), delete tasks and update the project templates (tutorial, task_presenter, and descriptions).

Installation

pbs is available in Pypi, so you can install the software with pip:

pip install pybossa-pbs

If you have all the dependencies, the package will be installed and you will be able to use it from the command line. The command is: pbs.

If you want to hack on the code, just install it but with the –editable flag after cloning the repository:

git clone https://github.com/PyBossa/pbs.git
cd pbs
virtualenv env
source env/bin/activate
pip install --editable .

This will install the pbs package, and you’ll be able to modify it, patch it, etc. If you improve it, please, let us know and share the code so we can integrate it back ;-)

Configuring pbs

pbs is very handy when you work with one or two PyBossa servers. The best way to configure it is creating a simple config file in your home folder:

cd ~
vim .pybossa.cfg

The file should have the following structure:

[default]
server: http://theserver.com
apikey: yourkey

If you are working with more servers, add another section below it. For example:

[default]
server: http://theserver.com
apikey: yourkey

[crowdcrafting]
server: http://crowdcrafting.org
apikey: yourkeyincrowdcrafting

By default pbs will use the credentials of the section default, so you don’t have to type anything to use those values. However, if you want to do actions in the other server all you have to do is the following:

pbs --credentials crowdcrafting --help

That command will use the values of the crowdcrafting section.

Creating a project

Creating a project is very simple. All you have to do is create a file named project.json with the following fields:

{
    "name": "Flickr Person Finder",
    "short_name": "flickrperson",
    "description": "Image pattern recognition",
    "question": "Do you see a real human face in this photo?"
}

If you use the name project.json you will not have to pass the file name via an argument, as it’s the named used by default. Once you have the file created, run the following command:

pbs create_project

That command should create the project. If you want to see all the available options, please check the –help command:

pbs create_project --help

Adding tasks to a project

Adding tasks is very simple. You can have your tasks in two formats:

  • JSON

  • CSV

Therefore, adding tasks to your project is as simple as this command:

pbs add_tasks --tasks-file tasks_file.json --tasks-type=json

If you want to see all the available options, please check the –help command:

pbs add_tasks --help

Updating project templates

Now that you have added tasks, you can work in your templates. All you have to do to add/update the templates to your project is running the following command:

pbs update_project

That command needs to have in the same folder where you are running it, the following files:

  • template.html

  • long_description.md

  • tutorial.html

If you want to use another template, you can via arguments:

pbs update_project --template /tmp/template.html

If you want to see all the available options, please check the –help command:

pbs update_project --help

Deleting tasks from a project

If you need it, you can delete all the tasks from your project, or only one using its task.id. For deleting all the tasks, all you’ve to do is run the following command:

pbs delete_tasks

This command will confirm that you want to delete all the tasks and associated task_runs.

If you want to see all the available options, please check the –help command:

pbs delete_tasks --help

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

pybossa-pbs-1.0.tar.gz (9.6 kB view details)

Uploaded Source

Built Distribution

pybossa_pbs-1.0-py2-none-any.whl (9.8 kB view details)

Uploaded Python 2

File details

Details for the file pybossa-pbs-1.0.tar.gz.

File metadata

  • Download URL: pybossa-pbs-1.0.tar.gz
  • Upload date:
  • Size: 9.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pybossa-pbs-1.0.tar.gz
Algorithm Hash digest
SHA256 93c963b4d798f2c4f66ff0a0c5eeba439ca9d43196d57afcda54fbe4f124ab6f
MD5 ccf2d3314f298075dbb7aaceb3f2a25d
BLAKE2b-256 43c34be7f40944f5071e6c91b1129a562367cdb4624b0b057c810193a1908f3a

See more details on using hashes here.

File details

Details for the file pybossa_pbs-1.0-py2-none-any.whl.

File metadata

File hashes

Hashes for pybossa_pbs-1.0-py2-none-any.whl
Algorithm Hash digest
SHA256 b22b86f36e17b85f0f33e29b3d0dca2f4d03b154e624ba02dcdc7b2e808dec74
MD5 0a9212755a4d308acc842754128bbd44
BLAKE2b-256 1ab2dc43511f17be84bed4d94b32fa002763a66e0ff801304590abed254b747f

See more details on using hashes here.

Supported by

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