Installation of the basepair Python package and associated command line interface (CLI). An outline of the contents on this page:


        1. Installation

        2. Configuration


1. Installation

Requirements

Python version 3. We no longer actively support python 2.


You need to first install the basepair Python package.

pip install basepair 


Once you have it installed, the “basepair” tool should now be available at the command line. Try running the following in your terminal:

basepair -h


2. Configuration


You need to obtain your configuration file to connect to Basepair’s API. To obtain the file:

  1. Go to your Basepair dashboard: https://app.basepairtech.com
  2. Click on your profile name in the top right corner
  3. Click on "Profile"
  4. Click on "Download API config file" in the upper right corner

When you get your configuration file it should look like the following:

{
  "api": {
    "cli": true,
    "host": "app.basepairtech.com",
    "prefix": "/api/v2/",
    "ssl": true,
    "username": "user@basepairtech.com",
    "key": ""
  }
}

The "key" is a unique code that allows you to access your Basepair account.



To make this file available to your API calls, you can do one of the following:


Option 1: Define an environment variable

export BP_CONFIG_FILE=/path/to/basepair.config.json

Option 2: Give it as a parameter when calling basepair

basepair -c /path/to/basepair.config.json


You can now use Basepair's suite of genomics tools from the command line or through the python API. For usage instructions, see the "Command Line API" or "Python API" tutorials.