Skip to main content

A Dropbox langchain integration

Project description

Canvas langchain document loader

Features:

Indexes Dropbox Files

The following file types are supported: md htm html docx xls xlsx pptx pdf rtf txt

(doc support would require libreoffice, so has not been implemented in this library)

Running locally

You can do the install as described below, or build/run the provider dockerfile.

Docker

Edit dropbox-test.py, fill in the correct auth and one of folder_path, file_path, or file_paths.

Run (this also builds docker):

docker run -it $(docker build -q .)

Installation

Install dependencies:

pip install -r requirements.txt

Usage example:

To use a refresh token, pass in api_key along with api_secret

from dropbox_files import DropboxLoader

auth = {
	"access_token": "ACCESS_TOKEN_FROM_OAUTH",
	"refresh_token": "REFRESH_TOKEN",
	"expires_at": "EXPIRE_TIMESTAMP"
}

loader = DropboxLoader(
	auth = auth,
	folder_path = "/PATH_TO_FOLDER_OR_EMPTY_STRING",
	# file_path = "/PATH/TO_FILE/File.extension",
	# file_paths = [
	# 	"/PATH/TO_FILE/File 1.extension",
	# 	"/PATH/TO_FILE/File 2.extension"
	# ],
	# api_key = "API_KEY",
	# api_secret = "API_SECRET",
)

documents = loader.load()

print("\nDocuments:\n")
print(documents)

print("\nInvalid files:\n")
print(loader.invalid_files)
print("")

print("\nErrors:\n")
print(loader.errors)
print("")

If errors are present, loader.errors will contain one list element per error. It will consist of an error message (key named message) and if the error pertains to a folder issue, a key named folder, for files a file key. Right now the library only catches Dropbox API specific exceptions.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dropbox_langchain-0.10.0.tar.gz (18.7 kB view details)

Uploaded Source

Built Distribution

dropbox_langchain-0.10.0-py3-none-any.whl (18.9 kB view details)

Uploaded Python 3

File details

Details for the file dropbox_langchain-0.10.0.tar.gz.

File metadata

  • Download URL: dropbox_langchain-0.10.0.tar.gz
  • Upload date:
  • Size: 18.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for dropbox_langchain-0.10.0.tar.gz
Algorithm Hash digest
SHA256 8448391064ad8df6881b3527a0d2ea18cdf08cd2e6fab28256d9c9ee02620247
MD5 f69acc2e45809da43b7a98b139631843
BLAKE2b-256 187d42591b79bb3af144fe5b479255e1a80e5599e719710502ea61eb2f96c7c3

See more details on using hashes here.

File details

Details for the file dropbox_langchain-0.10.0-py3-none-any.whl.

File metadata

File hashes

Hashes for dropbox_langchain-0.10.0-py3-none-any.whl
Algorithm Hash digest
SHA256 198032fed9f851d6c8b84ddaab1c80ccc11b22cf2930a7e80c1d32fc98fc4073
MD5 8ecb102bfe6298d1410e6eea35ec0df6
BLAKE2b-256 79cd1d314d756357decaad671d260514cbbd9ef7806cfbdd82a31578e57268b7

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page