refactor(cli): split cli.py into cli/ package#22
Merged
Conversation
…columns Rework all CLI presentations to match Typer/Rich conventions: - search/info/pull now print Rich tables by default, with consistent styling via typer.echo / typer.secho (red bold errors, yellow API warnings on stderr) and an opt-in --tsv flag for tab-separated machine output. - search: human-readable file sizes via rich.filesize.decimal; column labels renamed (type->media, file_extension->type, file_size->size, item_count->items) consistently across rich, --tsv, and --json; ids are always shown in full (overflow=fold). - info: bold filename header + variations/files table with optional sidecars table; URLs preserved via overflow=fold. - pull: pre-download summary table + green completion line. BREAKING CHANGE: gopro-api search plain output now renders a Rich table by default; previous tab-separated rows (with the "# _pages" metadata line and header) require the new --tsv flag. JSON output for search also renames per-item keys (type->media, file_extension->type, file_size->size, item_count->items) inside _embedded.media[*]. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Move all CLI logic from the single gopro_api/cli.py module into a dedicated gopro_api/cli/ package with one file per command (search, info, pull) plus shared helpers in _common.py. Co-authored-by: Cursor <cursoragent@cursor.com>
…mkdocs Add missing Google-style docstrings to every public and private function and method in the cli package (_common, app, info, pull, __main__). Expand docs/api/cli.md with a Printers section referencing SearchPrinter, InfoPrinter and PullPrinter so mkdocstrings renders them in the API site. Co-authored-by: Cursor <cursoragent@cursor.com>
… helper Introduce _SearchParams (frozen dataclass) to bundle the 7 search options, reducing _run_search from 8 keyword arguments to 2. Extract the all-pages streaming loop into _collect_all_pages to bring locals below the pylint R0914 threshold. Suppress R0913 on the Typer callback search_command via an inline pylint disable (framework callbacks must declare every CLI option as a parameter and cannot be refactored further). Co-authored-by: Cursor <cursoragent@cursor.com>
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.
No description provided.