Use the Python Library to manage your data

Using Darwin's Python Library opens up a number of ways to interact with your V7 data via the API. We'll run through a few examples like how to create new datasets, push data into existing datasets, and pull data and annotations from V7.

Getting started

You can read our full docs on Darwin Py here, but before we can put the Python Library to use, we'll want to make sure that we have three bases covered:

1. Install Python 3.7 or above

To use the most up-to-date version of Darwin's Python Library, we'll want to make sure that we have Python 3.7 or above installed. If you don't already have Python installed, you can download the most recent version here.

2. Install the Darwin Software Development Kit

To install the Darwin SDK, open the Command Prompt in Windows, or Terminal on a Mac, and enter the following command:

pip install darwin-py

If you've previously installed the SDK, make sure you're using the most up-to-date version by entering the following instead:

pip install darwin-py --upgrade

3. Generate an API key

You can generate an API key within V7 by selecting the gear icon and heading to API Keys. When generating the key, we're looking to accomplish two things:

  1. Encoding the team whose data we will be managing
  2. Encoding the permissions for the tasks that we want to run.

Hold on to your API key! We'll need it for our next task - creating a dataset.


Example Notebook

Learn how to use our Python SDK with this step-by-step jupyter notebook guide, complete with executable code examples and explanations.

This comprehensive guide covers authentication, dataset interaction, annotation classes and comment posting.

If you don't have a jupyter notebooks installed, using the following commands to install it:

pip install jupyter
pip install jupyter_contrib_nbextensions
jupyter contrib nbextension install --user
jupyter nbextension enable enable toc2/main


Team and Dataset Slugs

You will often be asked to enter a team-slug or dataset-slug as a parameter. If you are unsure on how to generate this then you can use the Slugify Python library.

Next up