Getting Started

Installing the Python SDK and Accessing Distributional UI

For getting access to the Distributional platform, please reach out to our team.

Installing Distributional

The dbnl SDK supports Python versions 3.9-3.12. You can install the latest release of the SDK with the following command on Linux or macOS, install a specific release, and install :

1. Latest Stable Release

To install the latest stable release of the dbnl package:

pip install dbnl

2. Specific Release

To install a specific version (e.g., version 0.19.1):

pip install "dbnl==0.19.1"

3. Installing with the eval Extra

The dbnl.eval extra includes additional features and requires an external spaCy model.

3.1. Install the Required spaCy Model

To install the required en_core_web_sm pretrained English-language NLP model model for spaCy:

pip install https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.8.0/en_core_web_sm-3.8.0-py3-none-any.whl

3.2. Install dbnl with the eval Extra

To install dbnl with evaluation extras:

pip install "dbnl[eval]"

If you need a specific version with evaluation extras (e.g., version 0.19.1):

pip install "dbnl[eval]==0.19.1"

Accessing the Distributional UI and API token

You should have already received an invite email from the Distributional team to create your account. If that is not the case, please reach out to your Distributional contact. You can access your token at https://app.dbnl.com/tokens (which will prompt you to login if you are not already).

We recommend setting your API token as an environment variable, see below.

Environment Variables

DBNL has three reserved environment variables that it reads in before execution.

Variable Name
Description

DBNL_API_TOKEN

The API token used to authenticate your dbnl account. You can generate your API token at https://app.dbnl.com/tokens

DBNL_API_URL

The base url of the Distributional API. For SaaS users, set this variable to api.dbnl.com. For other users, please contact your sys admin.

DBNL_APP_URL

An optional base url of the Distributional app. If this variable is not set, the app url is inferred from the DBNL_API_URL variable. For on-prem users, please contact your sys admin if you cannot reach the Distributional UI.

Linux/Mac OS Set Up

Run the following commands in your terminal. Make sure to wrap the API token in quotes.

echo 'export DBNL_API_TOKEN="copy_paste_dbnl_api_token"'| tee -a  ~/.zshrc || tee -a ~/.bashrc
echo 'export DBNL_API_URL="api.dbnl.com"'| tee -a  ~/.zshrc || tee -a ~/.bashrc
exec "$SHELL"

To confirm that the dbnl API Token is set in your environment, run the following command and verify its output is the correct token.

echo $DBNL_API_TOKEN
echo $DBNL_API_URL

Last updated

Was this helpful?