Conversation
Closes #3 - Add sort_by parameter with options: 'numeric', 'alpha', 'alpha_desc', 'none' - Add sort_key parameter for custom sort functions - 'numeric' extracts numbers from filenames for proper chapter ordering - Update CLI with --sort-by option - Export SORT_BY_OPTIONS constant
Closes #4 - Add deduplicate parameter (default True) to remove duplicate PDF URLs - Track seen PDFs across recursive calls using internal _seen_pdfs set - Preserves discovery order (first occurrence wins)
Closes #5 - Add output_name parameter to process_pdfs and download_pdfs_from_webpage - Add --output-name CLI option for merge mode - Filename is sanitized for security
Closes #6 - Add ProcessResult with success, files_created, downloaded_count, filtered_count, failed_count, errors - ProcessResult has __bool__ for backward compatibility in boolean contexts - Update process_pdfs to return ProcessResult - Update download_pdfs_from_webpage return type - Export ProcessResult from package
- Use dedicated 'fetcharoo' logger instead of root logger - Set default log level to WARNING (quiet by default) - Change verbose "Finding PDFs from" messages to DEBUG level - Add -q/--quiet flag to CLI to reduce output (-qq for even quieter) - Add -v/--verbose flag to CLI to increase output (-vv for debug) - Update tests to mock the named logger Closes #7, closes #8
- Add comprehensive test suite for enhancements (32 new tests): - Sort ordering tests (numeric, alpha, alpha_desc, custom key) - Deduplication tests - Custom output filename tests - ProcessResult dataclass tests - CLI verbosity flag tests - Update README with new features documentation: - New CLI options (--sort-by, --output-name, -q, -v) - Usage examples for sorting, ProcessResult - Updated API reference with new parameters
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment Thanks for integrating Codecov - We've got you covered ☂️ |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR implements a collection of enhancements to improve the usability and functionality of fetcharoo:
sort_byparameter (Add sort_key parameter for merge mode ordering #3)deduplicateparameter (Deduplicate PDF URLs by default #4)output_nameparameter (Add custom output filename for merge mode #5)ProcessResultdataclass with detailed download statistics (Return detailed result object from process_pdfs instead of bool #6)-q/--quietand-v/--verboseflags (Add --quiet flag to CLI #8)Changes
New Features
sort_by='numeric',sort_key=fn--sort-by numericdeduplicate=True(default)output_name='book.pdf'--output-name book.pdfProcessResultfetcharoo-q,-qq,-v,-vvFiles Changed
fetcharoo/fetcharoo.py- Core implementation of all featuresfetcharoo/cli.py- CLI argument parsing and logging configurationfetcharoo/__init__.py- Export new symbols (ProcessResult,SORT_BY_OPTIONS)README.md- Documentation for all new featurestests/test_enhancements.py- 32 new tests for all featurestests/test_*.py- Updated mocks to use named loggerTest Plan
Closes
Closes #3, closes #4, closes #5, closes #6, closes #7, closes #8