Getting Started
A CLI how-to guide. SDK power-users can refer to our full SDK docs generated from our source code here
The Darwin CLI offers the quickest method to upload and download large amounts of data to your datasets. Additionally, it supports importing and exporting annotations in multiple formats.
The CLI is part of the darwin-py
package which also includes our Python SDK. This section of the documentation will focus on the command line tool aspects.
Installation
pip install darwin-py
After installation, you can accessdarwin
directly from the command line.
Python Versions
Darwin-py has been tested for python >= 3.8 and <= 3.10 , while older or newer versions might work they are not officialy supported.
Team and Dataset Slugs
You will often be asked to enter a
team-slug
ordataset-slug
as a parameter. If you are unsure on how to generate this then you can use the Slugify Python library.
Authentication
To perform remote operations on Darwin, you must first authenticate with a team-specific API-key.
If you do not already have a Darwin account, you can contact us and we can set one up for you.
To start the authentication process:
$ darwin authenticate
API key: ***********
Make example-team the default team? [y/N] y
Datasets directory [~/.darwin/datasets]:
Authentication succeeded.
You will be then prompted to enter your API key, whether you want to set the corresponding team as default, and finally the desired location on the local file system for the datasets of that team. This process will create a configuration file at ~/.darwin/config.yaml
. This file will be updated with future authentications for different teams.
Permissions
The API key access permissions selected when requesting the key determine which commands in the SDK are allowed. If the key has insufficient permissions for an action an error will be shown:
Insufficient permissions
orInvalid API key
.
See the authentication in action!
Updated 3 months ago