Dropbox
Batch process all your records to store structured outputs in a Dropbox account.
The requirements are as follows.
-
A Dropbox app for your Dropbox account. To create a Dropbox app, do the following:
a) Sign in to the Dropbox Developers portal with the same credentials as your Dropbox account.
b) Open your App Console.
c) Click Create app.
d) For Choose an API, select Scoped access.
e) For Choose the type of access you need, select App folder.
f) Enter a name for your app, and then click Create app.
g) On the app’s Permissions tab, under Files and folders, check the boxes labelled files.content.read or files.content.write or both, depending on whether you want to read files, write files, or both. Then click Submit.
h) On the app’s Settings tab, note the value of the App folder name field. This is the name of the app folder that Dropbox will create under theApps
top-level folder in your Dropbox account that the Dropbox app will use for access. If you change the value of App folder name field here, Dropbox will create an app folder with that name under theApps
top-level folder instead.
i) Under OAuth 2, next to Generated access token, click Generate. Copy the value of this access token. You should only click Generate after you have completed all of the preceding steps first. This is because the access token is scoped to the specific app folder and settings at the time the access token is generated. If you change the app folder name or any of the permissions later, you should regenerate the access token. -
The app folder that your Dropbox app will use for access can be found in your Dropbox account under the
Apps
top-level folder. For example, if the value of the App folder name field above ismy-folder
, then the app folder that your Dropbox app will use for access can be found underhttps://dropbox.com/home/Apps/my-folder
Your Dropbox app will not have access to upload or download files from the root of the app folder. Instead, you must create a subfolder inside of the app folder for your Dropbox app to upload or download files from. You will use the name of that subfolder when specifying your remote URL in the next step. For example, if your Dropbox app uses an app folder named
my-folder
for access within theApps
top-level folder, and you create a subfolder nameddata
within themy-folder
app folder, then the subfolder that your Dropbox app will upload and download files from can be found underhttps://dropbox.com/home/Apps/my-folder/data
-
Note the remote URL to your subfolder inside of the app folder, which takes the format
dropbox://<subfolder-name>
. For example, if your Dropbox app uses an app folder namedmy-folder
for access within theApps
top-level folder, and you create a subfolder nameddata
within themy-folder
app folder, then the remote URL isdropbox://data
The Dropbox connector dependencies:
You might also need to install additional dependencies, depending on your needs. Learn more.
The following environment variables:
DROPBOX_REMOTE_URL
- The remote URL to the target subfolder inside of the app folder for the Dropbox app, represented by--remote-url
(CLI) orremote_url
(Python).DROPBOX_ACCESS_TOKEN
- The value of the access token for the Dropbox app that is associated with the target app folder, represented by--token
(CLI) ortoken
(Python).
Now call the Unstructured Ingest CLI or Unstructured Ingest Python. The source connector can be any of the ones supported. This example uses the local source connector.
This example sends files to Unstructured API services for processing by default. To process files locally instead, see the instructions at the end of this page.
For the Unstructured Ingest CLI and the Unstructured Ingest Python library, you can use the --partition-by-api
option (CLI) or partition_by_api
(Python) parameter to specify where files are processed:
-
To do local file processing, omit
--partition-by-api
(CLI) orpartition_by_api
(Python), or explicitly specifypartition_by_api=False
(Python).Local file processing does not use an Unstructured API key or API URL, so you can also omit the following, if they appear:
--api-key $UNSTRUCTURED_API_KEY
(CLI) orapi_key=os.getenv("UNSTRUCTURED_API_KEY")
(Python)--partition-endpoint $UNSTRUCTURED_API_URL
(CLI) orpartition_endpoint=os.getenv("UNSTRUCTURED_API_URL")
(Python)- The environment variables
UNSTRUCTURED_API_KEY
andUNSTRUCTURED_API_URL
-
To send files to Unstructured API services for processing, specify
--partition-by-api
(CLI) orpartition_by_api=True
(Python).Unstructured API services also requires an Unstructured API key and API URL, by adding the following:
--api-key $UNSTRUCTURED_API_KEY
(CLI) orapi_key=os.getenv("UNSTRUCTURED_API_KEY")
(Python)--partition-endpoint $UNSTRUCTURED_API_URL
(CLI) orpartition_endpoint=os.getenv("UNSTRUCTURED_API_URL")
(Python)- The environment variables
UNSTRUCTURED_API_KEY
andUNSTRUCTURED_API_URL
, representing your API key and API URL, respectively.
Was this page helpful?