36 add better writer support#37
Conversation
… doc/16-doc-how-to-add-a-new-provider
…vider Doc/16 doc how to add a new provider
…yLab/DocBinder-OSS into 36-add-better-writer-support
There was a problem hiding this comment.
Pull Request Overview
This PR introduces improved writer support with a dynamic, multi-format export feature while refactoring Google Drive functionality and removing Dropbox support. Key changes include updating Google Drive provider/client code, refactoring configuration and testing modules, and adding new tests for CSV/JSON and console writing.
Reviewed Changes
Copilot reviewed 31 out of 34 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/services/google_drive/test_google_drive_files.py | Removed outdated tests for Google Drive files. |
| tests/providers/google_drive/*.py | Updated provider tests and fixture usage for Google Drive permissions, files, and buckets. |
| src/docbinder_oss/providers/google_drive/*.py | Refactored Google Drive client/provider logic including file listing, metadata, and permissions. |
| src/docbinder_oss/helpers/writer.py | Introduced new MultiFormatWriter, CSVWriter, JSONWriter, and ConsoleWriter. |
| src/docbinder_oss/cli/search.py | Added search command for file filtering and export functionality. |
| Other CLI and config files | Consolidated provider commands and updated configuration management. |
| if min_size and file.size < min_size * 1024: | ||
| return False | ||
| if max_size and file.size > max_size * 1024: | ||
| return False |
There was a problem hiding this comment.
Since the 'size' field in File is defined as an Optional string, comparing it directly against an integer may lead to unexpected behavior. Consider converting the size to an integer (after verifying it is not None) before performing numeric comparisons.
| if min_size and file.size < min_size * 1024: | |
| return False | |
| if max_size and file.size > max_size * 1024: | |
| return False | |
| if file.size is not None: | |
| try: | |
| file_size_int = int(file.size) | |
| if min_size and file_size_int < min_size * 1024: | |
| return False | |
| if max_size and file_size_int > max_size * 1024: | |
| return False | |
| except ValueError: | |
| # Skip files with non-numeric size values | |
| return False |
c93b6e8
into
improve-gdrive-integration
Pull Request
Description
Added better support for the writing. Now it's dynamic so we can export multiple artifact and print is now better supported with rich
Fixes #36
Type of change
Checklist