etlplus 0.6.1__tar.gz → 0.8.6__tar.gz
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-0.6.1/etlplus.egg-info → etlplus-0.8.6}/PKG-INFO +8 -4
- {etlplus-0.6.1 → etlplus-0.8.6}/README.md +4 -3
- etlplus-0.8.6/docs/README.md +18 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/docs/pipeline-guide.md +22 -3
- {etlplus-0.6.1 → etlplus-0.8.6}/etlplus/api/README.md +24 -26
- etlplus-0.8.6/etlplus/cli/commands.py +870 -0
- etlplus-0.8.6/etlplus/cli/constants.py +65 -0
- etlplus-0.8.6/etlplus/cli/handlers.py +657 -0
- etlplus-0.8.6/etlplus/cli/io.py +320 -0
- etlplus-0.8.6/etlplus/cli/main.py +213 -0
- etlplus-0.8.6/etlplus/cli/options.py +49 -0
- etlplus-0.8.6/etlplus/cli/state.py +335 -0
- etlplus-0.8.6/etlplus/cli/types.py +33 -0
- etlplus-0.8.6/etlplus/database/__init__.py +44 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/etlplus/database/ddl.py +38 -30
- etlplus-0.8.6/etlplus/database/engine.py +151 -0
- etlplus-0.8.6/etlplus/database/orm.py +354 -0
- etlplus-0.8.6/etlplus/database/schema.py +274 -0
- etlplus-0.8.6/etlplus/database/types.py +33 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/etlplus/types.py +5 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/etlplus/utils.py +0 -31
- {etlplus-0.6.1 → etlplus-0.8.6/etlplus.egg-info}/PKG-INFO +8 -4
- {etlplus-0.6.1 → etlplus-0.8.6}/etlplus.egg-info/SOURCES.txt +15 -3
- {etlplus-0.6.1 → etlplus-0.8.6}/etlplus.egg-info/requires.txt +3 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/pyproject.toml +3 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/setup.py +3 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/tests/integration/test_i_pagination_strategy.py +1 -1
- etlplus-0.8.6/tests/unit/cli/conftest.py +183 -0
- etlplus-0.8.6/tests/unit/cli/test_u_cli_handlers.py +1155 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/tests/unit/cli/test_u_cli_main.py +32 -143
- etlplus-0.8.6/tests/unit/cli/test_u_cli_state.py +343 -0
- etlplus-0.8.6/tests/unit/database/test_u_database_engine.py +198 -0
- etlplus-0.8.6/tests/unit/database/test_u_database_orm.py +308 -0
- etlplus-0.8.6/tests/unit/database/test_u_database_schema.py +243 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/tests/unit/test_u_utils.py +0 -10
- etlplus-0.6.1/etlplus/cli/app.py +0 -1367
- etlplus-0.6.1/etlplus/cli/handlers.py +0 -774
- etlplus-0.6.1/etlplus/cli/main.py +0 -616
- etlplus-0.6.1/etlplus/database/__init__.py +0 -23
- etlplus-0.6.1/tests/unit/cli/conftest.py +0 -29
- etlplus-0.6.1/tests/unit/cli/test_u_cli_app.py +0 -582
- etlplus-0.6.1/tests/unit/cli/test_u_cli_handlers.py +0 -947
- etlplus-0.6.1/tools/run_pipeline.py +0 -561
- {etlplus-0.6.1 → etlplus-0.8.6}/.coveragerc +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/.editorconfig +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/.gitattributes +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/.github/actions/python-bootstrap/action.yml +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/.github/workflows/ci.yml +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/.gitignore +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/.pre-commit-config.yaml +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/.ruff.toml +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/CODE_OF_CONDUCT.md +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/CONTRIBUTING.md +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/DEMO.md +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/LICENSE +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/MANIFEST.in +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/Makefile +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/REFERENCES.md +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/docs/snippets/installation_version.md +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/etlplus/__init__.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/etlplus/__main__.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/etlplus/__version__.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/etlplus/api/__init__.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/etlplus/api/auth.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/etlplus/api/config.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/etlplus/api/endpoint_client.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/etlplus/api/errors.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/etlplus/api/pagination/__init__.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/etlplus/api/pagination/client.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/etlplus/api/pagination/config.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/etlplus/api/pagination/paginator.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/etlplus/api/rate_limiting/__init__.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/etlplus/api/rate_limiting/config.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/etlplus/api/rate_limiting/rate_limiter.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/etlplus/api/request_manager.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/etlplus/api/retry_manager.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/etlplus/api/transport.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/etlplus/api/types.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/etlplus/cli/__init__.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/etlplus/config/__init__.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/etlplus/config/connector.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/etlplus/config/jobs.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/etlplus/config/pipeline.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/etlplus/config/profile.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/etlplus/config/types.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/etlplus/config/utils.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/etlplus/enums.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/etlplus/extract.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/etlplus/file.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/etlplus/load.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/etlplus/mixins.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/etlplus/py.typed +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/etlplus/run.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/etlplus/run_helpers.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/etlplus/templates/__init__.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/etlplus/templates/ddl.sql.j2 +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/etlplus/templates/view.sql.j2 +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/etlplus/transform.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/etlplus/validate.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/etlplus/validation/__init__.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/etlplus/validation/utils.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/etlplus.egg-info/dependency_links.txt +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/etlplus.egg-info/entry_points.txt +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/etlplus.egg-info/top_level.txt +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/examples/README.md +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/examples/configs/ddl_spec.yml +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/examples/configs/pipeline.yml +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/examples/data/sample.csv +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/examples/data/sample.json +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/examples/data/sample.xml +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/examples/data/sample.xsd +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/examples/data/sample.yaml +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/examples/quickstart_python.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/pytest.ini +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/setup.cfg +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/tests/__init__.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/tests/conftest.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/tests/integration/conftest.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/tests/integration/test_i_cli.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/tests/integration/test_i_examples_data_parity.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/tests/integration/test_i_pipeline_smoke.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/tests/integration/test_i_pipeline_yaml_load.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/tests/integration/test_i_run.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/tests/integration/test_i_run_profile_pagination_defaults.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/tests/integration/test_i_run_profile_rate_limit_defaults.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/tests/unit/api/conftest.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/tests/unit/api/test_u_auth.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/tests/unit/api/test_u_config.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/tests/unit/api/test_u_endpoint_client.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/tests/unit/api/test_u_mocks.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/tests/unit/api/test_u_pagination_client.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/tests/unit/api/test_u_pagination_config.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/tests/unit/api/test_u_paginator.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/tests/unit/api/test_u_rate_limit_config.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/tests/unit/api/test_u_rate_limiter.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/tests/unit/api/test_u_request_manager.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/tests/unit/api/test_u_retry_manager.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/tests/unit/api/test_u_transport.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/tests/unit/api/test_u_types.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/tests/unit/config/test_u_config_utils.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/tests/unit/config/test_u_connector.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/tests/unit/config/test_u_jobs.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/tests/unit/config/test_u_pipeline.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/tests/unit/conftest.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/tests/unit/database/test_u_database_ddl.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/tests/unit/test_u_enums.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/tests/unit/test_u_extract.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/tests/unit/test_u_file.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/tests/unit/test_u_load.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/tests/unit/test_u_main.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/tests/unit/test_u_mixins.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/tests/unit/test_u_run.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/tests/unit/test_u_run_helpers.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/tests/unit/test_u_transform.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/tests/unit/test_u_validate.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/tests/unit/test_u_version.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/tests/unit/validation/test_u_validation_utils.py +0 -0
- {etlplus-0.6.1 → etlplus-0.8.6}/tools/update_demo_snippets.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: etlplus
|
|
3
|
-
Version: 0.6
|
|
3
|
+
Version: 0.8.6
|
|
4
4
|
Summary: A Swiss Army knife for simple ETL operations
|
|
5
5
|
Home-page: https://github.com/Dagitali/ETLPlus
|
|
6
6
|
Author: ETLPlus Team
|
|
@@ -21,7 +21,10 @@ Requires-Dist: jinja2>=3.1.6
|
|
|
21
21
|
Requires-Dist: pyodbc>=5.3.0
|
|
22
22
|
Requires-Dist: python-dotenv>=1.2.1
|
|
23
23
|
Requires-Dist: pandas>=2.3.3
|
|
24
|
+
Requires-Dist: pydantic>=2.12.5
|
|
25
|
+
Requires-Dist: PyYAML>=6.0.3
|
|
24
26
|
Requires-Dist: requests>=2.32.5
|
|
27
|
+
Requires-Dist: SQLAlchemy>=2.0.45
|
|
25
28
|
Requires-Dist: typer>=0.21.0
|
|
26
29
|
Provides-Extra: dev
|
|
27
30
|
Requires-Dist: black>=25.9.0; extra == "dev"
|
|
@@ -61,7 +64,7 @@ package and command-line interface for data extraction, validation, transformati
|
|
|
61
64
|
- [Quickstart](#quickstart)
|
|
62
65
|
- [Usage](#usage)
|
|
63
66
|
- [Command Line Interface](#command-line-interface)
|
|
64
|
-
- [
|
|
67
|
+
- [Check Pipelines](#check-pipelines)
|
|
65
68
|
- [Render SQL DDL](#render-sql-ddl)
|
|
66
69
|
- [Extract Data](#extract-data)
|
|
67
70
|
- [Validate Data](#validate-data)
|
|
@@ -179,6 +182,9 @@ etlplus --help
|
|
|
179
182
|
etlplus --version
|
|
180
183
|
```
|
|
181
184
|
|
|
185
|
+
The CLI is implemented with Typer (Click-based). There is no argparse compatibility layer, so rely
|
|
186
|
+
on the documented commands/flags and run `etlplus <command> --help` for current options.
|
|
187
|
+
|
|
182
188
|
#### Check Pipelines
|
|
183
189
|
|
|
184
190
|
Use `etlplus check` to explore pipeline YAML definitions without running them. The command can print
|
|
@@ -363,8 +369,6 @@ etlplus check --config examples/configs/pipeline.yml --summary
|
|
|
363
369
|
|
|
364
370
|
# Run a job
|
|
365
371
|
etlplus run --config examples/configs/pipeline.yml --job file_to_file_customers
|
|
366
|
-
|
|
367
|
-
# Deprecated shim (will be removed): etlplus pipeline
|
|
368
372
|
```
|
|
369
373
|
|
|
370
374
|
### Complete ETL Pipeline Example
|
|
@@ -19,7 +19,7 @@ package and command-line interface for data extraction, validation, transformati
|
|
|
19
19
|
- [Quickstart](#quickstart)
|
|
20
20
|
- [Usage](#usage)
|
|
21
21
|
- [Command Line Interface](#command-line-interface)
|
|
22
|
-
- [
|
|
22
|
+
- [Check Pipelines](#check-pipelines)
|
|
23
23
|
- [Render SQL DDL](#render-sql-ddl)
|
|
24
24
|
- [Extract Data](#extract-data)
|
|
25
25
|
- [Validate Data](#validate-data)
|
|
@@ -137,6 +137,9 @@ etlplus --help
|
|
|
137
137
|
etlplus --version
|
|
138
138
|
```
|
|
139
139
|
|
|
140
|
+
The CLI is implemented with Typer (Click-based). There is no argparse compatibility layer, so rely
|
|
141
|
+
on the documented commands/flags and run `etlplus <command> --help` for current options.
|
|
142
|
+
|
|
140
143
|
#### Check Pipelines
|
|
141
144
|
|
|
142
145
|
Use `etlplus check` to explore pipeline YAML definitions without running them. The command can print
|
|
@@ -321,8 +324,6 @@ etlplus check --config examples/configs/pipeline.yml --summary
|
|
|
321
324
|
|
|
322
325
|
# Run a job
|
|
323
326
|
etlplus run --config examples/configs/pipeline.yml --job file_to_file_customers
|
|
324
|
-
|
|
325
|
-
# Deprecated shim (will be removed): etlplus pipeline
|
|
326
327
|
```
|
|
327
328
|
|
|
328
329
|
### Complete ETL Pipeline Example
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Documentation Notes
|
|
2
|
+
|
|
3
|
+
## CLI Parser Status
|
|
4
|
+
- The CLI is now Typer/Click-only. The historical `argparse` parser and `create_parser` entrypoint
|
|
5
|
+
are deprecated and no longer supported for new integrations.
|
|
6
|
+
- Downstream tools should invoke the Typer app exported at `etlplus.cli.commands.app` (e.g., `python
|
|
7
|
+
-m etlplus` or `etlplus ...`).
|
|
8
|
+
- Handler functions still accept keyword arguments; the legacy namespace shim is temporary and will
|
|
9
|
+
be removed in a future release. Avoid constructing `argparse.Namespace` objects and instead call
|
|
10
|
+
handlers with explicit keyword arguments if you integrate programmatically.
|
|
11
|
+
|
|
12
|
+
## Migration Hints
|
|
13
|
+
- Replace any imports of `etlplus.cli.main.create_parser` with Typer invocations (`etlplus` binary
|
|
14
|
+
or `app` directly).
|
|
15
|
+
- If you maintained custom subcommands around the old parser, port them to Typer by attaching to
|
|
16
|
+
`app` or wrapping the `etlplus` executable.
|
|
17
|
+
- Tests and examples now target the Typer surface; expect argparse-focused helpers (e.g., namespace
|
|
18
|
+
format flags) to be absent.
|
|
@@ -7,6 +7,28 @@ ETLPlus focuses on simple, JSON-first ETL. The pipeline file is a declarative de
|
|
|
7
7
|
runner (a script, Makefile, CI job) can parse and execute using ETLPlus primitives: `extract`,
|
|
8
8
|
`validate`, `transform`, and `load`.
|
|
9
9
|
|
|
10
|
+
CLI note: ETLPlus uses Typer for command parsing and does not ship an argparse shim. Use the
|
|
11
|
+
documented `etlplus` commands and flags (check `etlplus --help`) when wiring your runner.
|
|
12
|
+
|
|
13
|
+
## Running a pipeline from YAML (CLI)
|
|
14
|
+
|
|
15
|
+
Use the built-in `etlplus run` command to execute jobs defined in a pipeline YAML. The command reads
|
|
16
|
+
your config, resolves vars and env placeholders, then runs the requested job:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
# List jobs with the check command
|
|
20
|
+
etlplus check --config examples/configs/pipeline.yml --jobs
|
|
21
|
+
|
|
22
|
+
# Run a specific job
|
|
23
|
+
etlplus run --config examples/configs/pipeline.yml --job file_to_file_customers
|
|
24
|
+
|
|
25
|
+
# Run another job from the same config
|
|
26
|
+
etlplus run --config examples/configs/pipeline.yml --job api_to_file_github_repos
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
For scripted usage inside a larger Python project, prefer importing the Python API directly (e.g.,
|
|
30
|
+
`extract`, `transform`, `validate`, `load`) instead of invoking the CLI subprocess.
|
|
31
|
+
|
|
10
32
|
## Top-level structure
|
|
11
33
|
|
|
12
34
|
A pipeline file typically includes:
|
|
@@ -401,9 +423,6 @@ Notes:
|
|
|
401
423
|
- For more details on the orchestration implementation, see
|
|
402
424
|
[Runner internals: etlplus.run](run-module.md).
|
|
403
425
|
|
|
404
|
-
Deprecated: `etlplus pipeline` is still available as a shim but will be removed in a future release;
|
|
405
|
-
prefer `check` and `run`.
|
|
406
|
-
|
|
407
426
|
### Python: `etlplus.run.run`
|
|
408
427
|
|
|
409
428
|
To trigger a job programmatically, use the high-level runner function exposed by the package:
|
|
@@ -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
|
|
11
|
-
|
|
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
|
|
56
|
+
rows = client.paginate("list", pagination=pg)
|
|
58
57
|
for row in rows:
|
|
59
58
|
print(row)
|
|
60
59
|
```
|
|
61
60
|
|
|
62
|
-
### Overriding
|
|
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-
|
|
103
|
+
## Cursor-Based Pagination Example
|
|
105
104
|
|
|
106
105
|
```python
|
|
107
|
-
from etlplus.api import EndpointClient, PaginationConfig
|
|
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
|
|
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
|
|
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`
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
`
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
`
|
|
210
|
-
|
|
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
|
|
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
|
|
221
|
-
|
|
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
|
|
222
|
+
## Minimal Contract
|
|
225
223
|
|
|
226
224
|
- Inputs
|
|
227
225
|
- `base_url: str`, `endpoints: dict[str, str]`
|