Installation

In order to use the Command Line Interface (CLI), you must install the Python Client. This will also install the CLI. In addition, users need to create an API token & secret on the Web Application.

Create connection profile

To create a profile, run bf profile create from the command line:

bf profile create

You then be taken through the steps to name your profile. Give your profile a unique name, and enter the API token and secret.

img { 
  max-width: 100%
}

$ bf profile create

Blackfynn profile setup assistant
Create a profile:
  Profile name [default]:
Creating profile 'default'
  API token: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
  API secret: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Would you like to set 'default' as default (Y/n)? y
Default profile: default

You have now created a new profile. To see a list of your profiles, run bf profile list

$ bf profile list

Profiles:
* default

Finally, to verify that your profile was set up correctly, run bf env

$ bf status

Active profile:
  default

Blackfynn environment:
  User          : <your email>
  Organization  : <your organization>
  API Location  : https://api.blackfynn.io
  Streaming API : https://streaming.blackfynn.io

Usage

$ bf help

usage:
  bf [options] [<command>] [<args>...]

Available commands:
  append        Append data to a datset
  cache         Perform cache operations
  create        Create dataset or collection
  dataset       Dataset actions
  delete        Delete item
  env           Display bf environment
  path          Show path to item
  profile       Profile management
  upload        Upload file(s) or directory
  search        Search datasets
  show          Show datasets, orgs, or contents of an item

global options:
  -h --help                 Show help
  --profile=<name>          Use specified profile (instead of default)

Basic examples

Show your setup

$ bf status

Active profile:
  default

Blackfynn environment:
  User          : jane@jdlabs.com
  Organization  : Jane Doe Labs (id: N:organization:ad63985-47e4-47b0-b1ab-91821b7517d7)
  API Location  : https://api.blackfynn.io
  Streaming API : https://streaming.blackfynn.io

Show your datasets

$ bf datasets

Datasets:
 * Dataset 1 (id: N:dataset:4ebh463d-c5df-42a9-aa5f-5cfebf843af3)
 * Dataset 2 (id: N:dataset:cf42f5f3-ceae-4a60-8ede-7d383a9ad7b7)

Search for things

$ bf search Fred

* <TimeSeries name='Fred Tugwell' id='N:package:5385f12f-879e-4d9e-a3c2-b7ff798972d8'>
* <TimeSeries name='Fred Heard' id='N:a3e6f016-f9b7-44f3-bb74-0a027935fba6'>

Show path to specific item

bf where 'N:package:1234-1234-1234-1234'

Uploading Files using the Python Client

You can use the Python client to upload data to the Blackfynn platform. 

Upload a file into a Dataset.

bf upload 'N:dataset:1234-1234-1234-1234' /path/to/my_data.nii.gz

Append data into an existing TimeSeries object 

NOTE: append process currently only supports timeseries data

bf append 'N:package:1234-1234-1234-1234' /path/to/data_i_want_to_append.mef
Did this answer your question?