etlplus 0.7.0__py3-none-any.whl → 0.8.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
etlplus/api/README.md CHANGED
@@ -7,8 +7,8 @@ paginated REST endpoints.
7
7
  - Supports page-, offset-, and cursor-based pagination via `PaginationConfig`
8
8
  - Simple bearer-auth credentials via `EndpointCredentialsBearer`
9
9
  - Convenience helpers to extract records from nested JSON payloads
10
- - Returns the shared `JSONRecords` alias (a list of `JSONDict`) for paginated responses, matching
11
- the rest of the library.
10
+ - Returns paginated JSON payloads (lists of record dictionaries) consistent with the rest of the
11
+ library.
12
12
 
13
13
  Back to project overview: see the top-level [README](../../README.md).
14
14
 
@@ -29,7 +29,6 @@ import requests
29
29
  from etlplus.api import (
30
30
  EndpointClient,
31
31
  EndpointCredentialsBearer,
32
- JSONRecords,
33
32
  )
34
33
 
35
34
  auth = EndpointCredentialsBearer(
@@ -54,12 +53,12 @@ client = EndpointClient(
54
53
 
55
54
  # Page-based pagination
56
55
  pg: PaginationConfig = {"type": "page", "page_size": 100}
57
- rows: JSONRecords = client.paginate("list", pagination=pg)
56
+ rows = client.paginate("list", pagination=pg)
58
57
  for row in rows:
59
58
  print(row)
60
59
  ```
61
60
 
62
- ### Overriding rate limits per call
61
+ ### Overriding Rate Limits Per Call
63
62
 
64
63
  When a client is constructed with ``rate_limit`` metadata you can still tweak the pacing for
65
64
  individual calls by passing ``rate_limit_overrides`` to ``paginate``/``paginate_iter``. The
@@ -101,10 +100,10 @@ If the API responds like this:
101
100
 
102
101
  If the response is a list at the top level, you can omit `records_path`.
103
102
 
104
- ## Cursor-based pagination example
103
+ ## Cursor-Based Pagination Example
105
104
 
106
105
  ```python
107
- from etlplus.api import EndpointClient, PaginationConfig, JSONRecords
106
+ from etlplus.api import EndpointClient, PaginationConfig
108
107
 
109
108
  client = EndpointClient(
110
109
  base_url="https://api.example.com/v1",
@@ -125,7 +124,7 @@ pg: PaginationConfig = {
125
124
  # "start_cursor": "abc123",
126
125
  }
127
126
 
128
- rows: JSONRecords = client.paginate("list", pagination=pg)
127
+ rows = client.paginate("list", pagination=pg)
129
128
  for row in rows:
130
129
  process(row)
131
130
  ```
@@ -192,36 +191,35 @@ client = EndpointClient(
192
191
  providers can fall back to their own defaults. If you already possess a static token, attach it to a
193
192
  `requests.Session` manually rather than instantiating `EndpointCredentialsBearer`.
194
193
 
195
- ## Errors and rate limiting
194
+ ## Errors and Rate Limiting
196
195
 
197
196
  - Errors: `ApiRequestError`, `ApiAuthError`, and `PaginationError` (in `etlplus/api/errors.py`)
198
197
  include an `as_dict()` helper for structured logs.
199
- - Rate limiting: `RateLimiter` and its `resolve_sleep_seconds` helper (in
200
- `etlplus/api/rate_limiter.py`) derives fixed sleeps or `max_per_sec` windows. The paginator now
201
- builds a `RateLimiter` whenever the effective delay comes from
202
- `rate_limit`/`rate_limit_overrides`, so each page fetch sleeps before making another HTTP call.
203
- Passing `rate_limit_overrides` to `paginate*` lets you momentarily speed up or slow down a single
204
- request without mutating the client-wide defaults.
205
-
206
- ## Types and transport
207
-
208
- - Types: pagination config helpers live in `etlplus/api/paginator.py`; retry helpers (including
209
- `RetryPolicy`) live in `etlplus/api/retry_manager.py`; rate-limit helpers live in
210
- `etlplus/api/rate_limiter.py`. These are all re-exported from `etlplus.api` for convenience.
198
+ - Rate limiting: `RateLimiter` (in `etlplus/api/rate_limiting/rate_limiter.py`) derives fixed sleeps
199
+ or `max_per_sec` windows. The paginator now builds a `RateLimiter` whenever the effective delay
200
+ comes from `rate_limit`/`rate_limit_overrides`, so each page fetch sleeps before making another
201
+ HTTP call. Passing `rate_limit_overrides` to `paginate*` lets you momentarily speed up or slow
202
+ down a single request without mutating the client-wide defaults.
203
+
204
+ ## Types and Transport
205
+
206
+ - Types: pagination config helpers live in `etlplus/api/pagination/paginator.py`; retry helpers
207
+ (including `RetryPolicy`) live in `etlplus/api/retry_manager.py`; rate-limit helpers live in
208
+ `etlplus/api/rate_limiting/rate_limiter.py`. These are all re-exported from `etlplus.api` for
209
+ convenience.
211
210
  - Transport/session: `etlplus/api/transport.py` contains the HTTP adapter helpers and
212
211
  `etlplus/api/request_manager.py` wraps `requests` sessions plus retry orchestration. Advanced
213
212
  users may consult those modules to adapt behavior.
214
213
 
215
- ## Supporting modules
214
+ ## Supporting Modules
216
215
 
217
216
  - `etlplus.api.types` collects friendly aliases such as `Headers`, `Params`, `Url`, and
218
217
  `RateLimitOverrides` (whose values accept numeric override inputs) so endpoint helpers share the
219
218
  same type vocabulary.
220
- - `etlplus.utils` exposes lightweight helpers used across the project, including CLI-friendly
221
- functions like `json_type`/`print_json` plus numeric coercion utilities (`to_float`,
222
- `to_positive_int`, etc.).
219
+ - `etlplus.utils` exposes lightweight helpers used across the project, including `print_json` and
220
+ numeric coercion utilities (`to_float`, `to_positive_int`, etc.).
223
221
 
224
- ## Minimal contract
222
+ ## Minimal Contract
225
223
 
226
224
  - Inputs
227
225
  - `base_url: str`, `endpoints: dict[str, str]`