-
Notifications
You must be signed in to change notification settings - Fork 96
Add CLAUDE.md #1168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Add CLAUDE.md #1168
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
# CLAUDE.md | ||
|
||
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. | ||
|
||
## Development Commands | ||
|
||
### Testing | ||
asonnenschein marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- **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 and Code Quality | ||
- **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 .` | ||
|
||
### Documentation | ||
- **Build docs**: `nox -s docs` | ||
- **Serve docs locally**: `nox -s watch` | ||
- **Test documentation examples**: `nox -s docs_test` | ||
|
||
### Example Testing | ||
- **Test all examples**: `nox -s examples` | ||
- **Test specific example**: `nox -s examples -- script_name.py` | ||
|
||
### Building and Publishing | ||
- **Build package**: `nox -s build` | ||
- **Clean build directories**: `nox -s clean` | ||
|
||
## Code Architecture | ||
|
||
### High-Level Structure | ||
The Planet SDK provides both a Python API and CLI for Planet's APIs (Data, Orders, Subscriptions, Features). | ||
|
||
### Core Components | ||
|
||
**API Clients** (`planet/clients/`): | ||
- `DataClient` - Search Planet's imagery catalog | ||
- `OrdersClient` - Process and download imagery | ||
- `SubscriptionsClient` - Auto-process and deliver imagery | ||
- `FeaturesClient` - Upload areas of interest | ||
|
||
**Sync Client** (`planet/sync/`): | ||
- `Planet` class - 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 authentication | ||
- `auth.py` - Authentication handling | ||
- `models.py` - Data models and response objects | ||
- `exceptions.py` - Custom exception classes | ||
|
||
**Request Building**: | ||
- `data_filter.py` - Data API search filters | ||
- `order_request.py` - Orders API request construction | ||
- `subscription_request.py` - Subscriptions API request construction | ||
|
||
### Key Patterns | ||
- 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.py` and `models.py` | ||
|
||
## Testing Configuration | ||
- 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 in `tests/integration/` | ||
|
||
## Code Style | ||
- 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 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.