Skip to content

[FEATURE] Papers Library BibTeX Importer#107

Merged
JonnyTran merged 302 commits into
developfrom
feat/bib-importer
Aug 2, 2025
Merged

[FEATURE] Papers Library BibTeX Importer#107
JonnyTran merged 302 commits into
developfrom
feat/bib-importer

Conversation

@JonnyTran
Copy link
Copy Markdown
Member

This pull request implements the Papers Library Importer feature as described in issue #102:

  • Adds import analysis endpoint (POST /imports/analyze) for parsing .bib and matching PDFs
  • Implements preview table UI for add/update/skip/failed actions
  • Adds bulk upload endpoint (POST /documents/bulk) with async job queue
  • Tracks progress and logs import history
  • Integrates imported documents into workspace with metadata and collection tags

Completes analysis, preview, and execution phases. Please review and let me know any feedback.

JonnyTran and others added 26 commits July 17, 2025 16:01
- Marked the completion of the document upload job system in the tasks documentation.
- Improved the `upload_document_job` function to include retry capabilities and enhanced error handling.
- Updated the import execution logic to support bulk document uploads, including file handling and progress tracking.
- Added detailed logging for document processing and error scenarios to facilitate debugging.
- Marked the completion of the document upload job system in the tasks documentation.
- Improved the `upload_document_job` function to include retry capabilities and enhanced error handling.
- Updated the import execution logic to support bulk document uploads, including file handling and progress tracking.
- Added detailed logging for document processing and error scenarios to facilitate debugging.
- Removed redundant comments and improved code clarity in the BibTeX import function.
- Introduced helper functions for parsing authors and years from BibTeX entries.
- Streamlined the matching of PDF files to BibTeX entries and the construction of document payloads.
- Enhanced error handling and user prompts during the bulk upload process.
- Updated the import analysis logic to improve readability and maintainability.
- Removed redundant comments and improved code clarity in the BibTeX import function.
- Introduced helper functions for parsing authors and years from BibTeX entries.
- Streamlined the matching of PDF files to BibTeX entries and the construction of document payloads.
- Enhanced error handling and user prompts during the bulk upload process.
- Updated the import analysis logic to improve readability and maintainability.
- Updated the bulk upload endpoint to validate JSON metadata and check for existing workspaces before processing uploads.
- Improved error handling for invalid metadata formats and missing documents.
- Refactored the `process_bulk_upload` function to accept `BulkUploadMetadata` directly, streamlining the upload logic.
- Enhanced the `upload_document_job` to handle document creation and error logging more effectively.
- Updated the bulk upload endpoint to validate JSON metadata and check for existing workspaces before processing uploads.
- Improved error handling for invalid metadata formats and missing documents.
- Refactored the `process_bulk_upload` function to accept `BulkUploadMetadata` directly, streamlining the upload logic.
- Enhanced the `upload_document_job` to handle document creation and error logging more effectively.
- Renamed and updated schemas for document metadata, including `FileMetadataInfo` to `DocumentMetadata` and `BulkUploadMetadata` to `DocumentsBulkCreate`.
- Adjusted the bulk upload endpoint to utilize the new schema and improved response handling with `DocumentsBulkResponse`.
- Enhanced validation logic for document metadata during import analysis and bulk uploads.
- Updated related tests to reflect schema changes and ensure proper validation of document uploads.
- Renamed and updated schemas for document metadata, including `FileMetadataInfo` to `DocumentMetadata` and `BulkUploadMetadata` to `DocumentsBulkCreate`.
- Adjusted the bulk upload endpoint to utilize the new schema and improved response handling with `DocumentsBulkResponse`.
- Enhanced validation logic for document metadata during import analysis and bulk uploads.
- Updated related tests to reflect schema changes and ensure proper validation of document uploads.
- Updated the bulk upload endpoint to accept `documents_metadata` as a form field, improving clarity in the API.
- Added JSON validation for `documents_metadata` to ensure proper format before processing.
- Introduced a new `bulk_create` method in `DocumentPolicy` to manage authorization for bulk uploads based on workspace membership.
- Refactored related functions to streamline the handling of document uploads and improve error handling.
- Updated the bulk upload endpoint to accept `documents_metadata` as a form field, improving clarity in the API.
- Added JSON validation for `documents_metadata` to ensure proper format before processing.
- Introduced a new `bulk_create` method in `DocumentPolicy` to manage authorization for bulk uploads based on workspace membership.
- Refactored related functions to streamline the handling of document uploads and improve error handling.
… tracking

- Created the ImportHistory model in the database with relationships to Workspace and User models.
- Added fields for tracking import details such as bib_filename and import_summary.
- Updated the factories to include ImportHistoryFactory for generating test data.
- Marked the completion of the ImportHistory model in the tasks documentation.
… tracking

- Created the ImportHistory model in the database with relationships to Workspace and User models.
- Added fields for tracking import details such as bib_filename and import_summary.
- Updated the factories to include ImportHistoryFactory for generating test data.
- Marked the completion of the ImportHistory model in the tasks documentation.
- Modified the Alembic command in the documentation and `.env` files to streamline migration processes.
- Added `HF_HUB_DISABLE_TELEMETRY=1` to both development and test environment configurations to disable telemetry.
- Updated the `pyproject.toml` to include a new command for generating Alembic revisions with autogeneration.
- Modified the Alembic command in the documentation and `.env` files to streamline migration processes.
- Added `HF_HUB_DISABLE_TELEMETRY=1` to both development and test environment configurations to disable telemetry.
- Updated the `pyproject.toml` to include a new command for generating Alembic revisions with autogeneration.
…ments` table during the upgrade and downgrade processes.
…ments` table during the upgrade and downgrade processes.
- Renamed `ImportExecuteRequest` to `DocumentImportExecuteRequest` and updated its fields to include `workspace_id`.
- Changed `ImportAction` to `DocumentImportAction` with enhanced action descriptions.
- Modified the `ImportHistory` model to replace `bib_filename` and `document_info` with `filename` and `metadata`, respectively, for improved data tracking.
- Updated related factories and tests to reflect changes in the import history structure and ensure accurate metadata handling.
- Adjusted bulk upload logic to align with new request and response schemas.
- Renamed `ImportExecuteRequest` to `DocumentImportExecuteRequest` and updated its fields to include `workspace_id`.
- Changed `ImportAction` to `DocumentImportAction` with enhanced action descriptions.
- Modified the `ImportHistory` model to replace `bib_filename` and `document_info` with `filename` and `metadata`, respectively, for improved data tracking.
- Updated related factories and tests to reflect changes in the import history structure and ensure accurate metadata handling.
- Adjusted bulk upload logic to align with new request and response schemas.
Copilot AI review requested due to automatic review settings July 18, 2025 07:11
@JonnyTran JonnyTran requested review from a team as code owners July 18, 2025 07:11
JonnyTran and others added 17 commits August 2, 2025 09:40
…nability; update various styles for consistency across import-related components; enhance error handling in DocumentRepository; adjust document metadata handling in API schemas and contexts.
…ty; implement batch processing in GetJobStatusUseCase to optimize job status polling and reduce connection load.
…UseCase

- update related methods and components for consistency in handling Hugging Face datasets
- improve author separator logic in ImportFileUpload component.
@JonnyTran JonnyTran marked this pull request as ready for review August 2, 2025 21:44
@JonnyTran JonnyTran added this to the v0.6.0 milestone Aug 2, 2025
@JonnyTran JonnyTran merged commit e39d536 into develop Aug 2, 2025
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants