planet-client-python
planet-client-python copied to clipboard
Tasking API
This PR provides a complete, production-ready Tasking 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/1186
Key Features
- Feature parity with Planet Tasking API reference
- AsyncIterator support for listing orders with pagination
- Order state management with wait functionality
- UUID validation for order IDs
- Error handling with Planet SDK exception patterns
- CLI integration with common Planet CLI patterns
- Comprehensive testing with both unit and integration tests
Details
- Async TaskingClient (planet/clients/tasking.py)
- Full async API client with all core methods
- Create, get, cancel, list, and wait for tasking orders
- Get order results functionality
- Proper error handling and validation
- Follows existing SDK patterns
- Sync TaskingAPI (planet/sync/tasking.py)
- Synchronous wrapper around the async client
- All the same functionality as async version
- Integrated into the main Planet client
- CLI Commands (planet/cli/tasking.py)
- Complete CLI interface: planet tasking
- Commands: create-order, get-order, cancel-order, list-orders, wait-order, get-results
- Supports both JSON file input and direct command-line arguments
- Integrated into main CLI
- Comprehensive Testing
- Unit tests for TaskingClient and TaskingOrderStates
- Integration tests for both API and CLI
- Mock HTTP responses using respx
- Tests cover all major functionality
- Code Quality
- ✅ Linting passes (flake8, yapf)
- ✅ Type checking passes (mypy)
- Follows existing code conventions
- Proper documentation and docstrings