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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dropbox_langchain-0.11.0.tar.gz.
File metadata
- Download URL: dropbox_langchain-0.11.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a83b29a9bb9114e6db18f0f414ce19bd4e4bea25e99fd95e7ceb20f1dc7a756e
|
|
| MD5 |
5366631d2447fdc33961858582aa34e2
|
|
| BLAKE2b-256 |
37bd4420146ac7d87e8a77cbccbad2f866293dbf2f04a513adbef59e463b8c6b
|
File details
Details for the file dropbox_langchain-0.11.0-py3-none-any.whl.
File metadata
- Download URL: dropbox_langchain-0.11.0-py3-none-any.whl
- Upload date:
- Size: 18.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0e45fb6c2dbe065cedff5a65fa1e75d0ea6a45d11c6d15335daa0ddd31a257dd
|
|
| MD5 |
9a62f35501603e88844de1d07079a241
|
|
| BLAKE2b-256 |
225a295a301bb9cdc080f5570c1b7e54819e30673645c6227fc5eeb2b9d385b8
|