planet-client-python icon indicating copy to clipboard operation
planet-client-python copied to clipboard

Reports API

Open asonnenschein opened this issue 5 months ago • 0 comments

This PR provides a complete, production-ready Reports API client that seamlessly integrates with the existing Planet Python SDK architecture and follows all established patterns and conventions. Generated with help from Claude Code:

Ticket

https://github.com/planetlabs/planet-client-python/issues/1190

Key Features

  • API Endpoints: List reports, get report details, create/delete reports, download report content, check status, list types/formats
  • Error Handling: Proper APIError and ClientError propagation
  • Authentication: Uses existing Planet SDK authentication system
  • Consistent Patterns: Follows exact same patterns as other Planet API clients
  • Type Hints: Full type annotations throughout
  • Documentation: Comprehensive docstrings for all methods
  • CLI Features: JSON config files, output redirection, pretty-printing, help text

Details

  1. Async Client SDK (planet/clients/reports.py)
    • ReportsClient class extending _BaseClient
    • Methods: list_reports, get_report, create_report, download_report, get_report_status, delete_report, list_report_types, get_report_export_formats
    • Full async/await support following existing patterns
  2. Sync Client SDK (planet/sync/reports.py)
    • ReportsAPI class wrapping the async client
    • Same method signatures with synchronous execution
    • Integrated into Planet class as planet.reports
  3. CLI Implementation (planet/cli/reports.py)
    • Complete CLI commands: list, get, create, download, status, delete, types, formats
    • Integrated into main CLI as planet reports
    • Support for JSON config files, output redirection, and formatting options
  4. Comprehensive Test Suite
    • Unit tests for async client (13 tests)
    • Unit tests for sync client (8 tests)
    • Unit tests for CLI (14 tests)
    • Integration tests for both sync/async clients and CLI
  5. Package Integration
    • Added to planet.clients.init.py exports and client directory
    • Integrated into planet.sync.client.Planet class
    • Added to main CLI command registration

Code Quality

  • Passes linting (flake8, yapf)
  • Follows PEP8 style guidelines
  • Matches existing codebase patterns
  • Proper error handling and type safety
  • Integration tests verify functionality

asonnenschein avatar Aug 13 '25 19:08 asonnenschein