Skip to content

Commit 3e6b2bf

Browse files
dreamiurgclaude
andauthored
feat: add ascent report command (#5)
* docs: add design document for ascent report command Adds comprehensive design for new 'peakbagger ascent show' command that retrieves detailed ascent reports from PeakBagger.com. Design covers: - Command structure and CLI interface - Data model extensions to Ascent model - HTML parsing strategy for ascent detail pages - Output formatting (text and JSON) - Testing approach with real PeakBagger data 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * feat: extend Ascent model with fields for detailed reports Add optional fields to Ascent model for ascent detail pages: - Ascent metadata (type, peak info, location, elevation) - GPX-derived metrics (gain, distance, duration) - Trip report content (text, external URL) Update to_dict() to serialize new fields conditionally. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * feat: add parser for ascent detail pages Add parse_ascent_detail() method to extract: - Basic ascent metadata (date, type, climber, peak) - Location and elevation information - GPX-derived metrics (gain, distance, duration) - Full trip report text and external URLs Handles various date formats and missing fields gracefully. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * feat: add formatter for ascent detail display Add format_ascent_detail() method supporting: - Text mode: Rich table with metadata, formatted trip report - JSON mode: Structured output via to_dict() - Number formatting with commas - Duration display in hours/minutes - Conditional field display (skip None values) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * refactor: clean up imports in formatters.py - Move Text import to top-level imports - Remove redundant json and Table imports in format_ascent_detail() - Use _print_json() helper instead of manual JSON serialization All tests passing. No functional changes. * feat: add 'peakbagger ascent show' command Add new command to retrieve detailed ascent reports: - New 'ascent' command group - 'show' subcommand accepting ascent ID - Supports --format (text/json) and --rate-limit options - Fetches from /climber/ascent.aspx endpoint - Displays metadata, GPX metrics, and trip report Examples: peakbagger ascent show 12963 peakbagger ascent show 12963 --format json 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * test: add tests for ascent detail parsing and command Add comprehensive test coverage: - Parser tests with real HTML (full report and minimal) - VCR-based integration tests for CLI command - Text and JSON output format validation - Tests use real PeakBagger data 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * docs: add ascent show command to documentation Update README with: - Command syntax and options - Sample output showing metadata and trip report - JSON format example Update CLAUDE.md with ascent command in development section. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * chore: fix linting and formatting issues - Rename show function to show_ascent in ascent command to avoid ruff F811 redefinition error - Apply ruff formatting to models.py for long Field definition - All tests pass, no functional changes 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * test: remove tests that depended on temporary files Remove parser tests that relied on /tmp HTML files. These were development artifacts. The VCR-based integration tests provide adequate coverage for the ascent show command and parsing logic. All tests now pass cleanly. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 13024d8 commit 3e6b2bf

File tree

0 file changed

+0
-0
lines changed

    0 file changed

    +0
    -0
    lines changed

    0 commit comments

    Comments
     (0)