Dataloop's CLI
  • Print
  • Share
  • Dark
    Light

Dataloop's CLI

  • Print
  • Share
  • Dark
    Light

The Dataloop CLI is an SDK tool allowing you to easily browse and perform actions locally on the platform.

Dataloop's CLI

The Dataloop CLI is performed on a Command-Line Interface "CLI" using the Dataloop Python dtlpy package, which enables a Python connection to Dataloop's environment.
This tool is one of the many Python SDK tools we offer to help you customize your experience with Dataloop.

Common use cases

  • Local login
  • Upload & Download files
  • Manage packages, functions and pipelines
    To learn more about the command line shell, click here.

Install & Login

Start by installing and logging in to the Dataloop Python dtlpy package.

Validate install

C:\Users\admin>dlp login
2020-01-07 13:52:36.146 [ERROR]- dtlpy: Token expired. Please login
2020-01-07 13:52:36.148 [WARNING]- dtlpy.services.cookie: Key not in platform cookie file: check_version_status. Return None
2020-01-07 11:52:36.218935
2020-01-07 13:52:36.223 [INFO]- dtlpy.services.api_client: Logging in to Dataloop...
2020-01-07 13:52:51.318 [INFO]- dtlpy.services.api_client: Logged in: eran@dataloop.ai
See "dlp --help" for options

Help

At any given point you may use the "--help" flag in dlp CLI. This provides all of the available options at your current position on the shell.
For example, seeing your options for dlp - projects.

dlp projects --help #The command line

Output

C:\Users\admin>dlp projects --help #The command line
usage: dlp projects [-h] {ls,create,checkout,web} ...

positional arguments:
  {ls,create,checkout,web}
                        projects operations
    ls                  List all projects #The "Is" command lists all of the projects
    create              Create a new project #The "create" command creates a new project
    checkout            checkout a project #The "checkout" command checkouts a project
    web                 Open in web browser #The "web" command opens the project in the browser

optional arguments:
  -h, --help            show this help message and exit

Examples Using Shell


This is an easy way to use the CLI with an auto-complete feature based on simple and intuitive commands.

Create a Project


After installing & logging in to the dtlp package, start by creating a new Project name - "my project"

Projects create --project-name "my project"

dataloop ci.gif

Create a Dataset


After creating your project, the next step is to update a Dataset - "my dataset"

Datasets create --dataset-name "my dataset"

dataloop ci 1.gif

Checkout a Project and a Dataset


By running "checkout" on a project or a dataset, every action from that point forward will be performed on the given project/dataset (this way you won’t need to repeat the project/dataset name for each action).

🚧 Once you checkout, every action you take will only apply to the specific project/dataset you're in
Projects checkout --project-name "my project" #For a project
Datasets checkout --dataset-name "my dataset" #For a dataset

Tip

You may checkout a project or a dataset using the --checkout flag in the create command:

projects create --project-name "my project" --checkout #For a project
datasets create --dataset-name "my dataset" --checkout #For a dataset

dataloop ci 1.gif

Verify Your Checkout State


Use this command to see which project/dataset you are in.

Checkout-state

dataloop ci 3.png

Upload Items


In this example, all Items are uploading from the folder "5_dogs" located on the local disk (C:).

Items upload --local-path "C:\5_dogs"

Tip

By using the --remote-path flag in the command, you may upload to a specific folder in your dataset .
For example, "dogs folder" will be created and items will be located in the dataset:
/dogs folder/5_dogs

items upload --local-path "C:\5_dogs" --remote-path "/dogs folder"

Download Items and Annotations


With this command, you can download Items and Annotations from the platform to your computer.
In the following example you will download all of the items and item's annotations in a JSON option to your local folder "C:\5_dogs" in two separate folders.

Items download --local-path "C:\5_dogs" --annotation-options json

dataloop ci 4.gif

Tip

  • You can download the annotations using the --without-binaries flag in the command:
items download --local-path "C:\5_dogs" --annotation-options json --without-binaries
  • You can download a specific folder from your dataset using the --remote-path flag in the command:
items download --local-path "C:\5_dogs" --remote-path "/dogs folder/5_dogs"
  • You can download annotations of a specific type or label

Learn more on Download Annotations of Internal Source page.

items download --local-path "C:\5_dogs" --annotation-filter-label "dog , cat" --annotation-filter-type "box, point"  --annotation-options "mask"

Command Line Interafce

For a full command list go here

Was This Article Helpful?