Setup
Installation of the Basepair Python package and CLI.
Contents:
- Installation
- Configuration
1. Installation
Requirements
- Python 3.8+ (Python 2 is no longer supported)
Install the package
pip install basepair
Once installed, the basepair command should be available:
basepair -h
2. Configuration
You need a configuration file to connect to Basepair’s API. To obtain it:
- Go to your dashboard: app.basepairtech.com
- Click your profile name (top-right).
- Click Profile.
- Click Download API config file (upper-right).
A downloaded file looks like:
{
"api_v3": {
"cli": true,
"host": "app.basepairtech.com",
"prefix": "/api/v3/",
"ssl": true,
"username": "user@basepairtech.com",
"key": "YOUR_API_KEY"
}
}
key is your personal access token. The api_v3 section targets the current API (v3). If your downloaded file still shows an api section with /api/v2/, see the migration guide to update it.
To make this file available to your API calls, choose one of the following:
Option 1 – environment variable (recommended)
export BP_CONFIG_FILE=/path/to/basepair.config.json
Option 2 – command-line flag
basepair -c /path/to/basepair.config.json
Option 3 – environment variables only (no file needed)
export BP_USERNAME=user@basepairtech.com
export BP_API_KEY=YOUR_API_KEY
You can now use Basepair’s genomics tools from the CLI or the Python API.
For usage details, see the Command-Line API or Python API tutorials.