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": "ACCESS_TOKEN_FROM_OAUTH",
  "refresh": "REFRESH_TOKEN",
  "id_token": "ID_TOKEN_NOT_USED",
  "expire": "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.4.tar.gz (16.8 kB view details)

Uploaded Source

Built Distribution

dropbox_langchain-0.4-py3-none-any.whl (17.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dropbox_langchain-0.4.tar.gz
  • Upload date:
  • Size: 16.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.13

File hashes

Hashes for dropbox_langchain-0.4.tar.gz
Algorithm Hash digest
SHA256 3ed0ca79f3b23444d50536931b55acf4b5ca01466c970e603b92b6de6c5c680a
MD5 1ef0b88b7f5b3a97f1dd74ce8353cfce
BLAKE2b-256 0abf7cd5efa24aca07dc3caf7b983de759e1ebc3d2f5dd76a5bba805978cb31c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for dropbox_langchain-0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 f97a0268db9df35e4ad02af7ae55b375c9510fa5d9792278feadc8fd8a4c3c22
MD5 9eddbe4d1c0fac8c257820d1825134ff
BLAKE2b-256 eebdc8b6e362d30544f7160f0075ce927c58185ce5b6cb5f0009487c299d0f0c

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