How mikewooster/api-client works
This is a Python HTTP API-client library: users define endpoint methods on an APIClient subclass, then invoke them to send requests and receive parsed results or domain-specific errors. The core path runs through a configurable request strategy, HTTP transport, response abstraction, and response handler. Authentication, request formatting, retries, pagination, and endpoint decorators are distinct extension capabilities. The map follows the sampled client and strategy code; README-documented features with unsampled implementations are shown with unverified links.
Main entry points: client.py APIClient · request_strategies.py Request Strategy · error_handlers.py Error Handler · response_handlers.py Response Handler
Components 14
Client Interface
- APIClient
apiclient/client.py - Endpoint Decorator
apiclient/decorates.py
Request Pipeline
- Authentication
apiclient/authentication_methods.py - Request Formatter
apiclient/request_formatters.py - Request Strategy
apiclient/request_strategies.py
Response Handling
- Response Adapter
apiclient/response.py - Response Handler
apiclient/response_handlers.py - Error Handler
apiclient/error_handlers.py - Client Exceptions
apiclient/exceptions.py
Client Extensions
- Pagination Decorator
apiclient/paginators.py - Retry Decorator
apiclient/retrying.py - Shared Types
apiclient/utils/typing.py
Other components
- API Consumer
- API Service
Connections 20
- API Consumer → APIClient: calls endpoints
README.md - APIClient → Authentication: initializes and reads
apiclient/client.py - APIClient → Request Formatter: configures and reads
apiclient/client.py - APIClient → Request Strategy: sets and dispatches
apiclient/client.py - APIClient → Response Handler: configures handler
apiclient/client.py - APIClient → Error Handler: configures handler
apiclient/client.py - APIClient → Endpoint Decorator: uses decorator
README.md - Request Strategy → APIClient: reads client settings
apiclient/request_strategies.py - Request Strategy → Request Formatter: formats request data
apiclient/request_strategies.py - Request Strategy → API Service: sends HTTP requests
apiclient/request_strategies.py - API Service → Request Strategy: returns HTTP response
apiclient/request_strategies.py - Request Strategy → Response Adapter: wraps response
apiclient/request_strategies.py - Request Strategy → Response Handler: decodes response
apiclient/request_strategies.py - Request Strategy → Error Handler: delegates failures
apiclient/request_strategies.py - Response Handler → Response Adapter: reads response data
apiclient/response_handlers.py - Error Handler → Response Adapter: reads status and body
apiclient/error_handlers.py - Error Handler → Client Exceptions: creates request errors
apiclient/error_handlers.py - Pagination Decorator → Request Strategy: selects paginated strategy
apiclient/paginators.py - Retry Decorator → APIClient: wraps request methods
README.md - APIClient → Shared Types: uses request types
apiclient/client.py