This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
- Run all tests:
nox(runs lint, analyze, test, coverage, docs) - Run tests only:
nox -s test - Run tests on specific Python version:
nox -s test-3.12 - Run single test file:
nox -s test-3.12 -- tests/unit/test_http.py - Run tests by keyword:
nox -s test-3.12 -- -k test__Limiter - Fast rerun (reuse environments):
nox -r
- Linting:
nox -s lint - Type checking:
nox -s analyze - Code coverage:
nox -s coverage - Format code:
yapf --in-place -r . - Check formatting:
yapf --diff -r .
- Build docs:
nox -s docs - Serve docs locally:
nox -s watch - Test documentation examples:
nox -s docs_test
- Test all examples:
nox -s examples - Test specific example:
nox -s examples -- script_name.py
- Build package:
nox -s build - Clean build directories:
nox -s clean
The Planet SDK provides both a Python API and CLI for Planet's APIs (Data, Orders, Subscriptions, Features).
API Clients (planet/clients/):
DataClient- Search Planet's imagery catalogOrdersClient- Process and download imagerySubscriptionsClient- Auto-process and deliver imageryFeaturesClient- Upload areas of interest
Sync Client (planet/sync/):
Planetclass - High-level synchronous interface combining all clients
CLI (planet/cli/):
- Entry point:
planet.cli.cli:main - Command modules:
data.py,orders.py,subscriptions.py,features.py
Core Infrastructure:
http.py- HTTP session management and authenticationauth.py- Authentication handlingmodels.py- Data models and response objectsexceptions.py- Custom exception classes
Request Building:
data_filter.py- Data API search filtersorder_request.py- Orders API request constructionsubscription_request.py- Subscriptions API request construction
- All API clients extend
base.py:BaseClient - Async and sync versions available (clients vs sync modules)
- CLI commands use Click framework with shared options in
options.py - Request/response validation via
specs.pyandmodels.py
- Uses pytest with configuration in
setup.cfg - Supports Python 3.9-3.13
- Coverage threshold: 90% (configured in setup.cfg)
- Integration tests require Planet API credentials
- Unit tests in
tests/unit/, integration tests intests/integration/
- Follows PEP8 via YAPF formatter
- Type hints checked with mypy
- Flake8 linting with specific ignores (see setup.cfg)
- Docstrings in Google format for auto-generated API docs