You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 26 Next »

The Brown Dog Command Line Interface (BD-CLI) provides users with an easy to use interface to Brown Dog services. It talks to various components of Brown Dog through its API. It can be used to do operations like file conversions and extractions. Please see the README for current instructions.

Installation

You can install BD-CLI from the PyPi repository by following these steps:

  1. Create a Python virtual environment in your computer using virtualenv, virtualenvwrapper or any other tool.
  2. Activate the created Python virtual environment
  3. Run the following command: 

    pip install bdcli

  4. This will install bdcli and all the dependent packages and you should see a new application bd from your terminal.

Working with Terminal

This section is intended only to those users who are working in a terminal for the very first time or are not very experienced using it. Others, please free to skip this section.

Example Transformations

Extraction

In the context of Brown Dog, extraction refers to the process of extracting relevant information from one or more data files. For example, finding out the location of people's faces in an image. You can use BD-CLI to perform an extraction operation by running the following command:

bd <input_file.ext>

Optionally you can use the ```-v``` flag

Conversion

Chaining Transformations


Help

Below you can see the output of the command (bd -h) which basically describes how to use this client:

BD-CLI Help
Brown Dog Command-Line Interface (BD-CLI)

=========================================

bd [OPTION] [FILE/DIRECTORY]

-----------------------------

Command line interface to Brown Dog services. Use to convert files between formats and extract various derived products

from file contents (e.g. tags, metadata, signatures, previews).

-b set the BD URL (e.g. https://bd-api.ncsa.illinois.edu)

-t set the token

-v verbose output

-w set wait time for conversions/extractions

-h display help

-o set output format

--outputs list the available output formats for the given file

--extractors list the available extractors for the given file

--find search current directory for a file similar to the given file

--bigdata use this flag if the file is large enough and it needs to be processed locally rather than using remote

 Brown Dog services

 **Examples:**

List available output formats for given file:

  bd --outputs image.pcd

Convert the given Kodak Photo CD image to a JPEG image.  Produces file image.jpg:

  bd -o jpg image.pcd

Convert a directory of images into the JPEG format:

  bd -o jpg images/

List available extractors for given file:

  bd --extractors image.jpg

Extract data from files contents (e.g. tags, previews, analysis, and other derived products).  Produces file image.json:

  bd image.jpg

Chain conversion and extraction.  Equivalent to the previous two examples:

  bd -o jpg image.pcd | bd

Index files within a directory:

  bd images/

Search for a similar file within a directory that has already been indexed:

  bd --find /path/image.jpg



  • No labels