docs: Improve API doc groups and polish docstrings#638
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #638 +/- ##
===========================================
+ Coverage 75.60% 96.71% +21.10%
===========================================
Files 45 46 +1
Lines 4271 4380 +109
===========================================
+ Hits 3229 4236 +1007
+ Misses 1042 144 -898
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Follow-up: #642 — Add |
There was a problem hiding this comment.
Pull request overview
This PR refactors how the Python API reference is organized and rendered by introducing a @docs_group() decorator on public symbols and updating the docs transformation pipeline to use those group assignments, while also polishing many docstrings for consistency and clarity (as requested in #637).
Changes:
- Added
src/apify_client/_docs.pywith a@docs_group()decorator and applied it broadly to public API symbols (clients, models, errors). - Updated
website/transformDocs.jsto derive documentation grouping from the Python@docs_group()decorator rather than JS-side name/kind heuristics. - Refined docstrings across the main client, HTTP clients, resource clients, and errors for more consistent “how to obtain / what it does” guidance.
Reviewed changes
Copilot reviewed 34 out of 34 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
website/transformDocs.js |
Switches grouping logic to use extracted docs_group decorator metadata and updates group ordering. |
src/apify_client/_docs.py |
Introduces the @docs_group() decorator and the allowed group name literals. |
src/apify_client/_apify_client.py |
Adds @docs_group() to ApifyClient/ApifyClientAsync and expands/polishes their docstrings. |
src/apify_client/_http_clients/_http_client.py |
Adds @docs_group() to HTTP clients and improves docstrings/parameter descriptions. |
src/apify_client/errors.py |
Adds @docs_group() to error types and expands error docstrings. |
src/apify_client/_resource_clients/actor_collection.py |
Adds @docs_group() and improves resource client docstrings. |
src/apify_client/_resource_clients/actor.py |
Adds @docs_group() and improves resource client docstrings. |
src/apify_client/_resource_clients/actor_env_var_collection.py |
Adds @docs_group() and improves resource client docstrings. |
src/apify_client/_resource_clients/actor_env_var.py |
Adds @docs_group() and improves resource client docstrings. |
src/apify_client/_resource_clients/actor_version_collection.py |
Adds @docs_group() and improves resource client docstrings. |
src/apify_client/_resource_clients/actor_version.py |
Adds @docs_group() and improves resource client docstrings. |
src/apify_client/_resource_clients/build_collection.py |
Adds @docs_group() and improves resource client docstrings. |
src/apify_client/_resource_clients/build.py |
Adds @docs_group() and improves resource client docstrings. |
src/apify_client/_resource_clients/dataset_collection.py |
Adds @docs_group() and improves resource client docstrings. |
src/apify_client/_resource_clients/dataset.py |
Adds @docs_group() to clients and a model (DatasetItemsPage) and improves docstrings. |
src/apify_client/_resource_clients/key_value_store_collection.py |
Adds @docs_group() and improves resource client docstrings. |
src/apify_client/_resource_clients/key_value_store.py |
Adds @docs_group() and improves resource client docstrings. |
src/apify_client/_resource_clients/log.py |
Adds @docs_group() and improves resource client docstrings. |
src/apify_client/_resource_clients/request_queue_collection.py |
Adds @docs_group() and improves resource client docstrings. |
src/apify_client/_resource_clients/request_queue.py |
Adds @docs_group() and improves resource client docstrings. |
src/apify_client/_resource_clients/run_collection.py |
Adds @docs_group() and improves resource client docstrings. |
src/apify_client/_resource_clients/run.py |
Adds @docs_group() and improves resource client docstrings. |
src/apify_client/_resource_clients/schedule_collection.py |
Adds @docs_group() and improves resource client docstrings. |
src/apify_client/_resource_clients/schedule.py |
Adds @docs_group() and improves resource client docstrings. |
src/apify_client/_resource_clients/status_message_watcher.py |
Adds @docs_group() and improves utility class docstrings. |
src/apify_client/_resource_clients/store_collection.py |
Adds @docs_group() and improves resource client docstrings. |
src/apify_client/_resource_clients/streamed_log.py |
Adds @docs_group() and improves utility class docstrings. |
src/apify_client/_resource_clients/task_collection.py |
Adds @docs_group() and improves resource client docstrings. |
src/apify_client/_resource_clients/task.py |
Adds @docs_group() and improves resource client docstrings. |
src/apify_client/_resource_clients/user.py |
Adds @docs_group() and improves resource client docstrings. |
src/apify_client/_resource_clients/webhook_collection.py |
Adds @docs_group() and improves resource client docstrings. |
src/apify_client/_resource_clients/webhook.py |
Adds @docs_group() and improves resource client docstrings. |
src/apify_client/_resource_clients/webhook_dispatch_collection.py |
Adds @docs_group() and improves resource client docstrings. |
src/apify_client/_resource_clients/webhook_dispatch.py |
Adds @docs_group() and improves resource client docstrings. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Pijukatel
left a comment
There was a problem hiding this comment.
Looks good. I have one optional comment
Add @docs_group decorator to organize public symbols into clear documentation sections (Apify API clients, Resource clients, HTTP clients, Models, Errors) instead of generic predicate-based grouping. Update transformDocs.js to read group names from the decorator. Closes #637 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Improve class-level docstrings for Apify API clients, resource clients, HTTP clients, and error classes to be more descriptive and consistent. Resource client docstrings now describe key operations and reference how to obtain an instance via the parent client. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use run.default_dataset_id instead of run['defaultDatasetId'] and add None check since call() returns Run | None. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
4fc07f0 to
81b7b42
Compare
Summary
@docs_group()decorator (following the crawlee-python pattern) to organize all public symbols into clear documentation groups: Apify API clients, Resource clients, HTTP clients, Models, and Errorswebsite/transformDocs.jsto read group assignments from the decorator instead of hardcoded JS predicatesScreenshot
Issues
Test plan
🤖 Generated with Claude Code