paper-dynasty-card-creation/pd_cards/commands/live_series.py
Cal Corum 2e28d29ced Add pd-cards CLI skeleton with Typer
Introduces new pd-cards CLI tool for all card creation workflows:
- custom: manage fictional character cards via YAML profiles
- live-series: live season card updates (stub)
- retrosheet: historical data processing (stub)
- scouting: scouting report generation (stub)
- upload: S3 card image upload (stub)

Key features:
- Typer-based CLI with auto-generated help and shell completion
- YAML profiles for custom characters (replaces per-character Python scripts)
- Preview, submit, new, and list commands for custom cards
- First character migrated: Kalin Young

Install with: uv pip install -e .
Run with: pd-cards --help

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-18 16:08:32 -06:00

52 lines
1.6 KiB
Python

"""
Live series card update commands.
Commands for generating cards from current season FanGraphs/Baseball Reference data.
"""
from pathlib import Path
import typer
from rich.console import Console
app = typer.Typer(no_args_is_help=True)
console = Console()
@app.command()
def update(
cardset: str = typer.Option(..., "--cardset", "-c", help="Target cardset name (e.g., '2025 Live')"),
season: int = typer.Option(None, "--season", "-s", help="Season year (defaults to current)"),
games_played: int = typer.Option(None, "--games", "-g", help="Number of games played (for prorating)"),
ignore_limits: bool = typer.Option(False, "--ignore-limits", help="Ignore minimum PA/TBF requirements"),
dry_run: bool = typer.Option(False, "--dry-run", "-n", help="Preview without saving to database"),
):
"""
Update live series cards from FanGraphs/Baseball Reference data.
Reads CSV files from data-input/ and generates batting/pitching cards.
"""
console.print()
console.print("=" * 70)
console.print(f"[bold]LIVE SERIES UPDATE - {cardset}[/bold]")
console.print("=" * 70)
if dry_run:
console.print("[yellow]DRY RUN - no changes will be made[/yellow]")
# TODO: Migrate logic from live_series_update.py
console.print()
console.print("[yellow]Not yet implemented - run legacy script:[/yellow]")
console.print(" python live_series_update.py")
raise typer.Exit(0)
@app.command()
def status(
cardset: str = typer.Option(None, "--cardset", "-c", help="Filter by cardset name"),
):
"""Show status of live series cardsets."""
console.print()
console.print("[yellow]Not yet implemented[/yellow]")