-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add method option to harvest command
Why these changes are being introduced: We would generally prefer to use the Sickle library's built-in ListRecords command to harvest records, but it doesn't work correctly for full harvests from ArchivesSpace. The best solution for now is to add the list method as an option, set as the default, with the current list-identifiers-then-get-each-record (get method) still available as an option when needed. How this addresses that need: * Adds `list_records` method to the OAIClient, along with a `retrieve_records` method that handles calling the internal logic of calling the correct internal method sequence based on the passed `method` argument. * Adds a `method` option to the harvest command with "get" and "list" options and "list" as the default. * Updates the OAIClient `get_identifiers` and `get_records` methods for clarity, efficienty, better error handling/logging, and to use Sickle's built-in deleted records handling. * Adds tests for new functionality, updates some existing tests and one cassette fixture to reflect changes. * Also adds an optional env variable to change the interval for logging status updates during a harvest. Side effects of this change: * External tools using this app will need to specify the get method when harvesting from ArchivesSpace. * The harvest command no longer logs the number of records to retrieve prior to harvesting those records, because 1) this is not possible at all using the list method and 2) when using the get method, it adds a memory inefficiency (storing all the identifiers in a list in memory instead of retrieving them on-demand via the generator function) that can be signficant for large harvests. Relevant ticket(s): * https://mitlibraries.atlassian.net/browse/RDI-176 * https://mitlibraries.atlassian.net/browse/RDI-177 * https://mitlibraries.atlassian.net/browse/RDI-181
- Loading branch information
Showing
9 changed files
with
4,868 additions
and
3,536 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.