Categories

Versions

Using the Dropbox Connector

The Dropbox Connector allows you to read and write to files in your Dropbox account directly from Altair AI Studio. There is no need for the Dropbox desktop client to be installed on your machine. This document will walk you through how to:

The Dropbox Connector uses an authentication mechanism called OAuth 2.0. Instead of giving your username and password, you generate an access token that can be used by Altair AI Studio to connect to your Dropbox account. This token cannot be used by any other applications and helps keep your Dropbox credentials secure.

Follow these steps to connect Altair AI Studio to Dropbox:

Connect to your Dropbox account

  1. In Altair AI Studio, right-click on the repository you want to store your Dropbox Connection in and choose New Connection Icon Create Connection.

    img/dropbox/01-create-new-connection.png

    You can also click on Connections > Create Connection New Connection Icon and select the Repository from the dropdown of the following dialog.

  2. Give a name to the new connection, and set Connection Type to Dropbox icon Dropbox:

    img/dropbox/02-create-select-dropbox-type.png

  3. Click on Create IconCreate and switch to the Setup tab in the Edit connection dialog.

  4. To the right of the Access Token field, click the Id Icon button to request an access token.

  5. Click on Request access token Website Icon to open the Dropbox website in your browser. If you are not already logged into your Dropbox account, you will have to do so now. You can manually copy the URL by clicking on Show URL instead.

    img/dropbox/03-dropbox-oauth.png

  6. Click Allow to give access to your Dropbox account and to generate a token:

    img/dropbox/04-allow-rapidminer-to-use-dropbox.png

  7. Copy the access token:

    img/dropbox/05-copy-authentication-code.png

  8. Return to Altair AI Studio, enter the access token, and click Complete IconComplete:

    img/dropbox/06-paste-dropbox-oauth.png

  9. While not required, we recommend testing your new Dropbox Connection by clicking the Connection Test Icon Test connection button at the bottom of the Edit connection window:

    img/dropbox/07-dropbox-test-connection.png

    If the test fails, check whether you copied the complete access token.

  10. Close the Edit connection dialog by clicking on Save IconSave.

You have successfully connected Altair AI Studio to your Dropbox account. The next sections will show you how to use this connector to read and write files.

Browse and read files

Reading files from Dropbox is incredibly simple using the Dropbox Connector:

  1. Drag a Read Dropbox operator into the Process Panel. Select your Dropbox Connection for the connection entry parameter from the Connections folder of the repository you stored it in by clicking on the repository chooser icon button next to it:

    img/dropbox/08-choose-connection-from-repo.png

    Alternatively, you can drag the Dropbox Connection from the repository into the Process Panel and connect the resulting operator with the Read Dropbox operator.

    img/dropbox/08-retrieve-connection-from-repo.png

  2. Click on the file chooser button file chooser icon to view the files in your Dropbox account. Select the file that you want to load and click File Chooser IconOpen.

    img/dropbox/09-read-dropbox-operator-open-file-dialog.png

  3. Connect the output of Read Dropbox to a suitable operator. In this case, we selected a .XLS file, so we will connect the output to a Read Excel operator:

    img/dropbox/10-dropbox-example-process.png

    As you can see in this example, the Read Dropbox operator works similarly to the Read File operator. It only loads the selected file but does not process it. The actual processing of the data takes place in additional operators such as Read Excel, Read CSV, or Read XML.

Write files to your Dropbox account

The Write Dropbox operator works similarly to the Write File operator: it expects a file as input (provided by another operator) and stores it at the specified location in your Dropbox account. As for the Read Dropbox operator, you can optionally provide the Dropbox Connection at the second port.

The simplest example using the Write Dropbox operator would be to connect it to the output of Read Dropbox. This setup would simply copy a file from one location in your Dropbox account to another without changing the file itself.

We will configure the Write Dropbox operator from the end of the previous section.

  1. Click on the Write Dropbox operator, select your Dropbox Connection in the Parameters view, and select a location for the new file via the file chooser File Chooser Icon. Note that by default the Write Dropbox operator does not overwrite existing files. Instead, a number is appended to the file name. For example, if Analysis_Results.xls already exists, the new file would be stored as Analysis_Results (1).xls. You can disable this feature by checking the overwrite parameter (visible in Expert Mode).

    img/dropbox/11-write-dropbox-overwrite.png

  2. Run Run Process the process and navigate to the location you specified. In the Dropbox online view, you can see that Analysis_Results.xls was successfully updated just a few seconds ago!

    img/dropbox/12-dropbox-overview.png