-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Background
The metpo codebase currently has inconsistent patterns for:
- Terminal output: Some scripts use
click.echo(), others userich.console.Console - Logging: Mix of standard
loggingmodule and ad-hoc approaches - Progress indication: Some use
tqdm, others use rich progress bars or nothing - Table display: Some use
rich.table.Table, others print plain text
Current State
Existing metpo scripts (metpo/scripts/*.py, metpo/bactotraits/*.py, etc.):
- Output:
click.echo() - Progress:
tqdm - Logging: standard
logging
Newly added madin scripts (metpo/scripts/madin/*.py):
- Output:
rich.console.Consolewith markup - Tables:
rich.table.Table - Logging: custom
get_logger()wrapper
Proposal
Establish and document a consistent pattern for all CLI scripts:
-
Output: Choose one of:
click.echo()(simpler, no color)rich.console.Console(richer formatting)
-
Logging: Standardize on:
- Standard
loggingmodule with consistent format - Or rich's logging handler for colored logs
- Standard
-
Progress: Choose one of:
tqdm(widely used)rich.progress(integrates with rich console)
-
Tables: Choose one of:
- Plain text / TSV output
rich.table.Tablefor terminal display
Tasks
- Document the chosen patterns in CLAUDE.md
- Create a shared utility module (e.g.,
metpo/cli_utils.py) with standard helpers - Refactor existing scripts to use the standard patterns
- Update madin scripts to match
Related
- Added
rich>=13.0.0as a dependency to support madin scripts - Scripts imported from biosample-enricher PR Release 2025-09-23 #200
Metadata
Metadata
Assignees
Labels
No labels