refactor: Consolidate public interface for v3#794
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #794 +/- ##
==========================================
- Coverage 97.73% 95.74% -2.00%
==========================================
Files 48 49 +1
Lines 4860 4863 +3
==========================================
- Hits 4750 4656 -94
- Misses 110 207 +97
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:
|
|
I'm not sure if |
Well, probably only |
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Yeah, that sounds good to me. Maybe we should think about the naming some more though |
…to `_internal_types.py` Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Description
Consolidates the public interface for the v3 release:
apify_clientnamespace now only exposesApifyClient,ApifyClientAsync, and__version__. This is a go-to for everyone.http_clientssubmodule (HttpClient,HttpClientAsync,HttpResponse,ImpitHttpClient,ImpitHttpClientAsync). Only for people who want to replace the default HTTP client.types.pymodule withTimeout,WebhooksList, andJsonSerializabletype aliases (can be used, e.g., for a custom HTTP client).__all__toerrors.py.I would prefer to keep
_modelsand_typeddictsprivate. They should not be considered safe to import, since exposing them publicly would potentially restrict future API changes. For typed dicts, users do not need to import them to pass inputs to resource client methods. Resource clients, which are also private and users should be able to get to them only viaApifyClient(and its async version), may return Pydantic models, but those models should not be constructed directly in user code. There may be niche cases where users want to import models or typed dicts for explicit typing or casts, but I would rather keep those available only on the user's own responsibility - we cannot guarantee that the types will not change. This is also a status quo in the current v2.5.This is my stand, let me know yours @janbuchar.
Issue
Closes: #744