Skip to main content

Documentation Index

Fetch the complete documentation index at: https://nvd-54.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Dropbox is a file hosting service that brings everything-traditional files, cloud content, and web shortcuts together in one place. 本 notebook 介绍如何load documents from Dropbox. In addition to common files such as text and PDF files, it also supports Dropbox Paper files.

前提条件

  1. Create a Dropbox app.
  2. Give the app these scope permissions: files.metadata.read and files.content.read.
  3. Generate access token: www.dropbox.com/developers/apps/create.
  4. pip install dropbox (requires pip install "unstructured[pdf]" for PDF filetype).

Instructions

`DropboxLoader“ requires you to create a Dropbox App and generate an access token. This can be done from www.dropbox.com/developers/apps/create. You also need to have the Dropbox Python SDK installed (pip install dropbox). DropboxLoader can load data from a list of Dropbox file paths or a single Dropbox folder path. Both paths should be relative to the root directory of the Dropbox account linked to the access token.
pip install dropbox
from langchain_community.document_loaders import DropboxLoader
# Generate access token: https://www.dropbox.com/developers/apps/create.
dropbox_access_token = "<DROPBOX_ACCESS_TOKEN>"
# Dropbox root folder
dropbox_folder_path = ""
loader = DropboxLoader(
    dropbox_access_token=dropbox_access_token,
    dropbox_folder_path=dropbox_folder_path,
    recursive=False,
)
documents = loader.load()
File /JHSfLKn0.jpeg could not be decoded as text. Skipping.
File /A REPORT ON WILES’ CAMBRIDGE LECTURES.pdf could not be decoded as text. Skipping.
for document in documents:
    print(document)