dropbox
dropbox
¶
Dropbox connector — bulk file sync via the Dropbox API v2.
Uses OAuth Bearer tokens stored locally.
All network calls are isolated in module-level functions (_dropbox_api_*)
to make them trivially mockable in tests.
Classes¶
DropboxConnector
¶
Bases: BaseConnector
Connector that syncs files from Dropbox via the REST API v2.
Authentication is handled through Dropbox OAuth 2.0. Tokens are stored locally in a JSON credentials file.
| PARAMETER | DESCRIPTION |
|---|---|
credentials_path
|
Path to the JSON file where OAuth tokens are stored. Defaults to
TYPE:
|
Source code in src/openjarvis/connectors/dropbox.py
Functions¶
is_connected
¶
Return True if a credentials file with a valid token exists.
disconnect
¶
auth_url
¶
Return a Dropbox OAuth consent URL requesting file access scopes.
Source code in src/openjarvis/connectors/dropbox.py
handle_callback
¶
Handle the OAuth callback by persisting the authorization code.
In a full implementation this would exchange the code for tokens. For now the code is saved directly as the token value.
Source code in src/openjarvis/connectors/dropbox.py
sync
¶
sync(*, since: Optional[datetime] = None, cursor: Optional[str] = None) -> Iterator[Document]
Yield :class:Document objects for Dropbox files.
Lists all files recursively. Text-extractable files (.txt, .md, .csv, .py, etc.) are downloaded and stored with their content. Other files are stored as metadata-only documents.
| PARAMETER | DESCRIPTION |
|---|---|
since
|
Not yet used (reserved for future incremental sync).
TYPE:
|
cursor
|
Dropbox list_folder cursor from a previous sync to resume pagination.
TYPE:
|
Source code in src/openjarvis/connectors/dropbox.py
199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 | |
sync_status
¶
sync_status() -> SyncStatus
Return sync progress from the most recent :meth:sync call.
Source code in src/openjarvis/connectors/dropbox.py
mcp_tools
¶
mcp_tools() -> List[ToolSpec]
Expose three MCP tool specs for real-time Dropbox queries.