dltaf 0.1.0__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.
- dltaf-0.1.0/LICENSE +159 -0
- dltaf-0.1.0/PKG-INFO +242 -0
- dltaf-0.1.0/README.md +198 -0
- dltaf-0.1.0/cli/__init__.py +23 -0
- dltaf-0.1.0/cli/generate_dags.py +413 -0
- dltaf-0.1.0/cli/show_lineage.py +146 -0
- dltaf-0.1.0/dag_builder/__init__.py +30 -0
- dltaf-0.1.0/dag_builder/builder.py +134 -0
- dltaf-0.1.0/dag_builder/dag_builder_core.py +253 -0
- dltaf-0.1.0/dag_builder/dependency_resolver.py +286 -0
- dltaf-0.1.0/dag_builder/manifest_loader.py +157 -0
- dltaf-0.1.0/dag_builder/task_factory.py +772 -0
- dltaf-0.1.0/dlt_pipelines/__init__.py +0 -0
- dltaf-0.1.0/dlt_pipelines/mongodb_runtime/__init__.py +1 -0
- dltaf-0.1.0/dlt_pipelines/mongodb_runtime/mongodb/__init__.py +116 -0
- dltaf-0.1.0/dlt_pipelines/mongodb_runtime/mongodb/helpers.py +624 -0
- dltaf-0.1.0/dlt_utils/__init__.py +7 -0
- dltaf-0.1.0/dlt_utils/airflow_dlt_runner.py +78 -0
- dltaf-0.1.0/dlt_utils/clickhouse_helpers.py +292 -0
- dltaf-0.1.0/dlt_utils/manifest_runner.py +1008 -0
- dltaf-0.1.0/dlt_utils/naming.py +47 -0
- dltaf-0.1.0/dlt_utils/oracle_serialization.py +49 -0
- dltaf-0.1.0/dlt_utils/vault_env.py +336 -0
- dltaf-0.1.0/dltaf/__init__.py +27 -0
- dltaf-0.1.0/dltaf/cli.py +133 -0
- dltaf-0.1.0/dltaf/examples/__init__.py +0 -0
- dltaf-0.1.0/dltaf/examples/manifests/__init__.py +0 -0
- dltaf-0.1.0/dltaf/examples/manifests/smoke_mongodb_catalog.yaml +25 -0
- dltaf-0.1.0/dltaf/examples/manifests/smoke_oracle_custom_sql.yaml +28 -0
- dltaf-0.1.0/dltaf/examples/manifests/smoke_sql_database_catalog.yaml +26 -0
- dltaf-0.1.0/dltaf/examples/sql/__init__.py +0 -0
- dltaf-0.1.0/dltaf/examples/sql/oracle_smoke_query.sql +1 -0
- dltaf-0.1.0/dltaf/plugins.py +392 -0
- dltaf-0.1.0/dltaf.egg-info/PKG-INFO +242 -0
- dltaf-0.1.0/dltaf.egg-info/SOURCES.txt +44 -0
- dltaf-0.1.0/dltaf.egg-info/dependency_links.txt +1 -0
- dltaf-0.1.0/dltaf.egg-info/entry_points.txt +8 -0
- dltaf-0.1.0/dltaf.egg-info/requires.txt +19 -0
- dltaf-0.1.0/dltaf.egg-info/top_level.txt +6 -0
- dltaf-0.1.0/lineage/__init__.py +40 -0
- dltaf-0.1.0/lineage/dependency_graph.py +298 -0
- dltaf-0.1.0/lineage/manifest_dependency_resolver.py +522 -0
- dltaf-0.1.0/pyproject.toml +79 -0
- dltaf-0.1.0/setup.cfg +4 -0
- dltaf-0.1.0/tests/test_source_plugin_registry.py +158 -0
- dltaf-0.1.0/tests/test_task_factory_runtime_resolution.py +207 -0
dltaf-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction, and
|
|
10
|
+
distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by the copyright
|
|
13
|
+
owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all other entities
|
|
16
|
+
that control, are controlled by, or are under common control with that entity.
|
|
17
|
+
For the purposes of this definition, "control" means (i) the power, direct or
|
|
18
|
+
indirect, to cause the direction or management of such entity, whether by
|
|
19
|
+
contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
20
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
21
|
+
|
|
22
|
+
"You" (or "Your") shall mean an individual or Legal Entity exercising
|
|
23
|
+
permissions granted by this License.
|
|
24
|
+
|
|
25
|
+
"Source" form shall mean the preferred form for making modifications, including
|
|
26
|
+
but not limited to software source code, documentation source, and configuration
|
|
27
|
+
files.
|
|
28
|
+
|
|
29
|
+
"Object" form shall mean any form resulting from mechanical transformation or
|
|
30
|
+
translation of a Source form, including but not limited to compiled object code,
|
|
31
|
+
generated documentation, and conversions to other media types.
|
|
32
|
+
|
|
33
|
+
"Work" shall mean the work of authorship, whether in Source or Object form, made
|
|
34
|
+
available under the License, as indicated by a copyright notice that is included
|
|
35
|
+
in or attached to the work.
|
|
36
|
+
|
|
37
|
+
"Derivative Works" shall mean any work, whether in Source or Object form, that
|
|
38
|
+
is based on (or derived from) the Work and for which the editorial revisions,
|
|
39
|
+
annotations, elaborations, or other modifications represent, as a whole, an
|
|
40
|
+
original work of authorship. For the purposes of this License, Derivative Works
|
|
41
|
+
shall not include works that remain separable from, or merely link (or bind by
|
|
42
|
+
name) to the interfaces of, the Work and Derivative Works thereof.
|
|
43
|
+
|
|
44
|
+
"Contribution" shall mean any work of authorship, including the original version
|
|
45
|
+
of the Work and any modifications or additions to that Work or Derivative Works
|
|
46
|
+
thereof, that is intentionally submitted to Licensor for inclusion in the Work
|
|
47
|
+
by the copyright owner or by an individual or Legal Entity authorized to submit
|
|
48
|
+
on behalf of the copyright owner. For the purposes of this definition,
|
|
49
|
+
"submitted" means any form of electronic, verbal, or written communication sent
|
|
50
|
+
to the Licensor or its representatives, including but not limited to
|
|
51
|
+
communication on electronic mailing lists, source code control systems, and
|
|
52
|
+
issue tracking systems that are managed by, or on behalf of, the Licensor for
|
|
53
|
+
the purpose of discussing and improving the Work, but excluding communication
|
|
54
|
+
that is conspicuously marked or otherwise designated in writing by the copyright
|
|
55
|
+
owner as "Not a Contribution."
|
|
56
|
+
|
|
57
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf
|
|
58
|
+
of whom a Contribution has been received by Licensor and subsequently
|
|
59
|
+
incorporated within the Work.
|
|
60
|
+
|
|
61
|
+
2. Grant of Copyright License. Subject to the terms and conditions of this
|
|
62
|
+
License, each Contributor hereby grants to You a perpetual, worldwide,
|
|
63
|
+
non-exclusive, no-charge, royalty-free, irrevocable copyright license to
|
|
64
|
+
reproduce, prepare Derivative Works of, publicly display, publicly perform,
|
|
65
|
+
sublicense, and distribute the Work and such Derivative Works in Source or
|
|
66
|
+
Object form.
|
|
67
|
+
|
|
68
|
+
3. Grant of Patent License. Subject to the terms and conditions of this License,
|
|
69
|
+
each Contributor hereby grants to You a perpetual, worldwide, non-exclusive,
|
|
70
|
+
no-charge, royalty-free, irrevocable (except as stated in this section) patent
|
|
71
|
+
license to make, have made, use, offer to sell, sell, import, and otherwise
|
|
72
|
+
transfer the Work, where such license applies only to those patent claims
|
|
73
|
+
licensable by such Contributor that are necessarily infringed by their
|
|
74
|
+
Contribution(s) alone or by combination of their Contribution(s) with the Work
|
|
75
|
+
to which such Contribution(s) was submitted. If You institute patent litigation
|
|
76
|
+
against any entity (including a cross-claim or counterclaim in a lawsuit)
|
|
77
|
+
alleging that the Work or a Contribution incorporated within the Work
|
|
78
|
+
constitutes direct or contributory patent infringement, then any patent licenses
|
|
79
|
+
granted to You under this License for that Work shall terminate as of the date
|
|
80
|
+
such litigation is filed.
|
|
81
|
+
|
|
82
|
+
4. Redistribution. You may reproduce and distribute copies of the Work or
|
|
83
|
+
Derivative Works thereof in any medium, with or without modifications, and in
|
|
84
|
+
Source or Object form, provided that You meet the following conditions:
|
|
85
|
+
|
|
86
|
+
(a) You must give any other recipients of the Work or Derivative Works a copy of
|
|
87
|
+
this License; and
|
|
88
|
+
|
|
89
|
+
(b) You must cause any modified files to carry prominent notices stating that You
|
|
90
|
+
changed the files; and
|
|
91
|
+
|
|
92
|
+
(c) You must retain, in the Source form of any Derivative Works that You
|
|
93
|
+
distribute, all copyright, patent, trademark, and attribution notices from the
|
|
94
|
+
Source form of the Work, excluding those notices that do not pertain to any part
|
|
95
|
+
of the Derivative Works; and
|
|
96
|
+
|
|
97
|
+
(d) If the Work includes a "NOTICE" text file as part of its distribution, then
|
|
98
|
+
any Derivative Works that You distribute must include a readable copy of the
|
|
99
|
+
attribution notices contained within such NOTICE file, excluding those notices
|
|
100
|
+
that do not pertain to any part of the Derivative Works, in at least one of the
|
|
101
|
+
following places: within a NOTICE text file distributed as part of the
|
|
102
|
+
Derivative Works; within the Source form or documentation, if provided along
|
|
103
|
+
with the Derivative Works; or, within a display generated by the Derivative
|
|
104
|
+
Works, if and wherever such third-party notices normally appear. The contents of
|
|
105
|
+
the NOTICE file are for informational purposes only and do not modify the
|
|
106
|
+
License. You may add Your own attribution notices within Derivative Works that
|
|
107
|
+
You distribute, alongside or as an addendum to the NOTICE text from the Work,
|
|
108
|
+
provided that such additional attribution notices cannot be construed as
|
|
109
|
+
modifying the License.
|
|
110
|
+
|
|
111
|
+
You may add Your own copyright statement to Your modifications and may provide
|
|
112
|
+
additional or different license terms and conditions for use, reproduction, or
|
|
113
|
+
distribution of Your modifications, or for any such Derivative Works as a whole,
|
|
114
|
+
provided Your use, reproduction, and distribution of the Work otherwise complies
|
|
115
|
+
with the conditions stated in this License.
|
|
116
|
+
|
|
117
|
+
5. Submission of Contributions. Unless You explicitly state otherwise, any
|
|
118
|
+
Contribution intentionally submitted for inclusion in the Work by You to the
|
|
119
|
+
Licensor shall be under the terms and conditions of this License, without any
|
|
120
|
+
additional terms or conditions. Notwithstanding the above, nothing herein shall
|
|
121
|
+
supersede or modify the terms of any separate license agreement you may have
|
|
122
|
+
executed with Licensor regarding such Contributions.
|
|
123
|
+
|
|
124
|
+
6. Trademarks. This License does not grant permission to use the trade names,
|
|
125
|
+
trademarks, service marks, or product names of the Licensor, except as required
|
|
126
|
+
for reasonable and customary use in describing the origin of the Work and
|
|
127
|
+
reproducing the content of the NOTICE file.
|
|
128
|
+
|
|
129
|
+
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in
|
|
130
|
+
writing, Licensor provides the Work (and each Contributor provides its
|
|
131
|
+
Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
132
|
+
KIND, either express or implied, including, without limitation, any warranties
|
|
133
|
+
or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
134
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
135
|
+
appropriateness of using or redistributing the Work and assume any risks
|
|
136
|
+
associated with Your exercise of permissions under this License.
|
|
137
|
+
|
|
138
|
+
8. Limitation of Liability. In no event and under no legal theory, whether in
|
|
139
|
+
tor t (including negligence), contract, or otherwise, unless required by
|
|
140
|
+
applicable law (such as deliberate and grossly negligent acts) or agreed to in
|
|
141
|
+
writing, shall any Contributor be liable to You for damages, including any
|
|
142
|
+
direct, indirect, special, incidental, or consequential damages of any character
|
|
143
|
+
arising as a result of this License or out of the use or inability to use the
|
|
144
|
+
Work (including but not limited to damages for loss of goodwill, work stoppage,
|
|
145
|
+
computer failure or malfunction, or any and all other commercial damages or
|
|
146
|
+
losses), even if such Contributor has been advised of the possibility of such
|
|
147
|
+
damages.
|
|
148
|
+
|
|
149
|
+
9. Accepting Warranty or Additional Liability. While redistributing the Work or
|
|
150
|
+
Derivative Works thereof, You may choose to offer, and charge a fee for,
|
|
151
|
+
acceptance of support, warranty, indemnity, or other liability obligations
|
|
152
|
+
and/or rights consistent with this License. However, in accepting such
|
|
153
|
+
obligations, You may act only on Your own behalf and on Your sole responsibility,
|
|
154
|
+
not on behalf of any other Contributor, and only if You agree to indemnify,
|
|
155
|
+
defend, and hold each Contributor harmless for any liability incurred by, or
|
|
156
|
+
claims asserted against, such Contributor by reason of your accepting any such
|
|
157
|
+
warranty or additional liability.
|
|
158
|
+
|
|
159
|
+
END OF TERMS AND CONDITIONS
|
dltaf-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: dltaf
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Manifest-driven data loading toolkit with Airflow helpers and pluggable source integrations.
|
|
5
|
+
Author: Pavel Kovalev
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
|
+
Project-URL: Homepage, https://github.com/PaulKov/dltaf
|
|
8
|
+
Project-URL: Documentation, https://paulkov.github.io/dltaf/
|
|
9
|
+
Project-URL: Issues, https://github.com/PaulKov/dltaf/issues
|
|
10
|
+
Project-URL: Changelog, https://github.com/PaulKov/dltaf/blob/main/CHANGELOG.md
|
|
11
|
+
Keywords: airflow,clickhouse,data-engineering,dlt,etl,plugins,yaml
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Intended Audience :: Information Technology
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Topic :: Database
|
|
21
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
22
|
+
Classifier: Topic :: System :: Distributed Computing
|
|
23
|
+
Requires-Python: >=3.10
|
|
24
|
+
Description-Content-Type: text/markdown
|
|
25
|
+
License-File: LICENSE
|
|
26
|
+
Requires-Dist: dlt[clickhouse,sql_database]<2,>=1.18.2
|
|
27
|
+
Requires-Dist: PyYAML>=6.0.1
|
|
28
|
+
Requires-Dist: vault-kv-client>=0.1.0
|
|
29
|
+
Requires-Dist: oracledb>=2.0.0
|
|
30
|
+
Requires-Dist: psycopg2-binary>=2.9.9
|
|
31
|
+
Requires-Dist: pymongo>=4.6.0
|
|
32
|
+
Requires-Dist: sqlalchemy>=2.0.25
|
|
33
|
+
Provides-Extra: dev
|
|
34
|
+
Requires-Dist: build>=1.2.2; extra == "dev"
|
|
35
|
+
Requires-Dist: mkdocs>=1.6.1; extra == "dev"
|
|
36
|
+
Requires-Dist: mkdocs-material>=9.6.14; extra == "dev"
|
|
37
|
+
Requires-Dist: pytest>=8.3.5; extra == "dev"
|
|
38
|
+
Requires-Dist: ruff>=0.11.5; extra == "dev"
|
|
39
|
+
Requires-Dist: twine>=6.1.0; extra == "dev"
|
|
40
|
+
Provides-Extra: docs
|
|
41
|
+
Requires-Dist: mkdocs>=1.6.1; extra == "docs"
|
|
42
|
+
Requires-Dist: mkdocs-material>=9.6.14; extra == "docs"
|
|
43
|
+
Dynamic: license-file
|
|
44
|
+
|
|
45
|
+
# dltaf
|
|
46
|
+
|
|
47
|
+
`dltaf` is a manifest-driven toolkit for building repeatable data-loading pipelines with `dlt`, optional Airflow DAG generation, and a plugin-first extension model.
|
|
48
|
+
|
|
49
|
+
The public package ships a clean OSS core:
|
|
50
|
+
- built-in source kinds for `oracle_custom_sql`, `sql_database`, and `mongodb`
|
|
51
|
+
- a unified source plugin registry
|
|
52
|
+
- Airflow runtime helpers for local, packaged, and virtualenv execution
|
|
53
|
+
- a Vault integration layer powered by [`vault-kv-client`](https://github.com/PaulKov/vault-kv-client)
|
|
54
|
+
- documentation and examples that stay safe to publish
|
|
55
|
+
|
|
56
|
+
Private integrations are intentionally not bundled into this repository. They can live in your monorepo, a private package index, or both, while still using the same `source.kind` contract.
|
|
57
|
+
|
|
58
|
+
## Why dltaf
|
|
59
|
+
|
|
60
|
+
- `YAML-first`: manifests stay readable and reviewable
|
|
61
|
+
- `plugin-first`: internal connectors plug in without forking the OSS core
|
|
62
|
+
- `Airflow-friendly`: isolated virtualenv tasks can resolve both the core package and private plugin requirements
|
|
63
|
+
- `Vault-ready`: one consistent secrets contract for source and destination credentials
|
|
64
|
+
- `self-service`: examples, docs, CLI inspection tools, and smoke-friendly workflows are included
|
|
65
|
+
|
|
66
|
+
## Installation
|
|
67
|
+
|
|
68
|
+
Runtime install:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
pip install dltaf
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Developer install:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
git clone https://github.com/PaulKov/dltaf.git
|
|
78
|
+
cd dltaf
|
|
79
|
+
python3 -m venv .venv
|
|
80
|
+
source .venv/bin/activate
|
|
81
|
+
pip install -U pip
|
|
82
|
+
pip install -e .[dev]
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Quick start
|
|
86
|
+
|
|
87
|
+
Validate an example manifest:
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
dltaf-run --manifest dltaf/examples/manifests/smoke_sql_database_catalog.yaml --validate-only
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Inspect available plugins:
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
dltaf plugins list
|
|
97
|
+
dltaf plugins inspect sql_database
|
|
98
|
+
dltaf plugins doctor --manifest dltaf/examples/manifests/smoke_mongodb_catalog.yaml
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Generate Airflow DAG files from a manifests directory:
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
dltaf-generate-dags --manifests-dir ./manifests --output-dir ./generated_dags
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Render lineage for a manifests directory:
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
dltaf-show-lineage --manifests-dir ./manifests --format mermaid
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## Built-in source kinds
|
|
114
|
+
|
|
115
|
+
### `oracle_custom_sql`
|
|
116
|
+
|
|
117
|
+
Use explicit SQL files and per-query metadata:
|
|
118
|
+
- one manifest can drive multiple queries
|
|
119
|
+
- merge mode can enforce `primary_key`
|
|
120
|
+
- SQL files stay separate from YAML
|
|
121
|
+
|
|
122
|
+
### `sql_database`
|
|
123
|
+
|
|
124
|
+
Use `dlt.sources.sql_database` in either:
|
|
125
|
+
- single-schema mode with `schema` + `tables`
|
|
126
|
+
- multi-schema mode with `schemas: {schema_name: {tables: [...]}}`
|
|
127
|
+
|
|
128
|
+
### `mongodb`
|
|
129
|
+
|
|
130
|
+
Use the bundled MongoDB runtime for:
|
|
131
|
+
- one or many collections
|
|
132
|
+
- optional collection filters and nesting control
|
|
133
|
+
- replace/append behavior through the manifest `run` section
|
|
134
|
+
|
|
135
|
+
## Private plugin UX
|
|
136
|
+
|
|
137
|
+
The public core is designed so private connectors can stay private without degrading developer experience.
|
|
138
|
+
|
|
139
|
+
### Option 1: local monorepo catalog
|
|
140
|
+
|
|
141
|
+
Point `dltaf` to a local plugin catalog:
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
export DLTAF_PLUGIN_PATHS="/path/to/monorepo/internal/dltaf_plugins"
|
|
145
|
+
dltaf plugins list
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
This is the softest rollout path when your private catalog still lives inside an existing monorepo.
|
|
149
|
+
|
|
150
|
+
### Option 2: importable plugin modules
|
|
151
|
+
|
|
152
|
+
Point `dltaf` to importable module names:
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
export DLTAF_PLUGIN_MODULES="company_private_plugins,team_connectors"
|
|
156
|
+
dltaf plugins list
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
### Option 3: installed private packages
|
|
160
|
+
|
|
161
|
+
Install a private package that exposes entry points in the `dltaf.plugins` group. `dltaf` will discover them automatically.
|
|
162
|
+
|
|
163
|
+
### Plugin contract
|
|
164
|
+
|
|
165
|
+
Every plugin registers one or more `SourcePlugin` objects with:
|
|
166
|
+
- `kind`
|
|
167
|
+
- `validate(manifest)`
|
|
168
|
+
- `build_runtime_env(manifest)` if needed
|
|
169
|
+
- `run(manifest)`
|
|
170
|
+
|
|
171
|
+
Canonical recommendation for private kinds:
|
|
172
|
+
|
|
173
|
+
```text
|
|
174
|
+
internal.customer_export
|
|
175
|
+
internal.partner_events
|
|
176
|
+
company.some_connector
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### Scaffold a new plugin
|
|
180
|
+
|
|
181
|
+
```bash
|
|
182
|
+
dltaf scaffold plugin --kind internal.customer_export --output-dir ./internal/dltaf_plugins
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
## Airflow
|
|
186
|
+
|
|
187
|
+
`dltaf` ships Airflow helpers for:
|
|
188
|
+
- generating DAGs from manifests
|
|
189
|
+
- loading `run_manifest()` inside standard or virtualenv tasks
|
|
190
|
+
- propagating plugin paths, plugin modules, and plugin-specific requirements to isolated runtimes
|
|
191
|
+
|
|
192
|
+
Useful runtime environment variables:
|
|
193
|
+
- `DLTAF_PACKAGE_ROOT`
|
|
194
|
+
- `DLTAF_PLUGIN_PATHS`
|
|
195
|
+
- `DLTAF_PLUGIN_MODULES`
|
|
196
|
+
- `DLTAF_PLUGIN_REQUIREMENTS`
|
|
197
|
+
|
|
198
|
+
See the full guide in [GitHub Pages](https://paulkov.github.io/dltaf/airflow/).
|
|
199
|
+
|
|
200
|
+
## Vault integration
|
|
201
|
+
|
|
202
|
+
`dltaf` resolves manifest Vault references through `vault-kv-client`.
|
|
203
|
+
|
|
204
|
+
Supported reference forms:
|
|
205
|
+
- `vault://mount/path`
|
|
206
|
+
- `mount:path`
|
|
207
|
+
- mapping form with `mount_point`, `path`, and optional `kv_version`
|
|
208
|
+
|
|
209
|
+
This keeps the secrets contract stable across local runs, CI, and Airflow.
|
|
210
|
+
|
|
211
|
+
## Examples
|
|
212
|
+
|
|
213
|
+
The repository ships sanitized examples under `dltaf/examples/`:
|
|
214
|
+
- `smoke_oracle_custom_sql.yaml`
|
|
215
|
+
- `smoke_sql_database_catalog.yaml`
|
|
216
|
+
- `smoke_mongodb_catalog.yaml`
|
|
217
|
+
|
|
218
|
+
They are intentionally generic. Replace the sample Vault refs and connection settings with your own environment before running them against a live system.
|
|
219
|
+
|
|
220
|
+
## Documentation
|
|
221
|
+
|
|
222
|
+
Full docs live on GitHub Pages:
|
|
223
|
+
|
|
224
|
+
- Docs: https://paulkov.github.io/dltaf/
|
|
225
|
+
- Plugin guide: https://paulkov.github.io/dltaf/plugins/
|
|
226
|
+
- Airflow guide: https://paulkov.github.io/dltaf/airflow/
|
|
227
|
+
- Examples: https://paulkov.github.io/dltaf/examples/
|
|
228
|
+
|
|
229
|
+
## Development
|
|
230
|
+
|
|
231
|
+
Run the standard checks locally:
|
|
232
|
+
|
|
233
|
+
```bash
|
|
234
|
+
ruff check .
|
|
235
|
+
pytest
|
|
236
|
+
python -m build
|
|
237
|
+
mkdocs build
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
## License
|
|
241
|
+
|
|
242
|
+
Apache-2.0. See [LICENSE](LICENSE).
|
dltaf-0.1.0/README.md
ADDED
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
# dltaf
|
|
2
|
+
|
|
3
|
+
`dltaf` is a manifest-driven toolkit for building repeatable data-loading pipelines with `dlt`, optional Airflow DAG generation, and a plugin-first extension model.
|
|
4
|
+
|
|
5
|
+
The public package ships a clean OSS core:
|
|
6
|
+
- built-in source kinds for `oracle_custom_sql`, `sql_database`, and `mongodb`
|
|
7
|
+
- a unified source plugin registry
|
|
8
|
+
- Airflow runtime helpers for local, packaged, and virtualenv execution
|
|
9
|
+
- a Vault integration layer powered by [`vault-kv-client`](https://github.com/PaulKov/vault-kv-client)
|
|
10
|
+
- documentation and examples that stay safe to publish
|
|
11
|
+
|
|
12
|
+
Private integrations are intentionally not bundled into this repository. They can live in your monorepo, a private package index, or both, while still using the same `source.kind` contract.
|
|
13
|
+
|
|
14
|
+
## Why dltaf
|
|
15
|
+
|
|
16
|
+
- `YAML-first`: manifests stay readable and reviewable
|
|
17
|
+
- `plugin-first`: internal connectors plug in without forking the OSS core
|
|
18
|
+
- `Airflow-friendly`: isolated virtualenv tasks can resolve both the core package and private plugin requirements
|
|
19
|
+
- `Vault-ready`: one consistent secrets contract for source and destination credentials
|
|
20
|
+
- `self-service`: examples, docs, CLI inspection tools, and smoke-friendly workflows are included
|
|
21
|
+
|
|
22
|
+
## Installation
|
|
23
|
+
|
|
24
|
+
Runtime install:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
pip install dltaf
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Developer install:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
git clone https://github.com/PaulKov/dltaf.git
|
|
34
|
+
cd dltaf
|
|
35
|
+
python3 -m venv .venv
|
|
36
|
+
source .venv/bin/activate
|
|
37
|
+
pip install -U pip
|
|
38
|
+
pip install -e .[dev]
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Quick start
|
|
42
|
+
|
|
43
|
+
Validate an example manifest:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
dltaf-run --manifest dltaf/examples/manifests/smoke_sql_database_catalog.yaml --validate-only
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Inspect available plugins:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
dltaf plugins list
|
|
53
|
+
dltaf plugins inspect sql_database
|
|
54
|
+
dltaf plugins doctor --manifest dltaf/examples/manifests/smoke_mongodb_catalog.yaml
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Generate Airflow DAG files from a manifests directory:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
dltaf-generate-dags --manifests-dir ./manifests --output-dir ./generated_dags
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Render lineage for a manifests directory:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
dltaf-show-lineage --manifests-dir ./manifests --format mermaid
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Built-in source kinds
|
|
70
|
+
|
|
71
|
+
### `oracle_custom_sql`
|
|
72
|
+
|
|
73
|
+
Use explicit SQL files and per-query metadata:
|
|
74
|
+
- one manifest can drive multiple queries
|
|
75
|
+
- merge mode can enforce `primary_key`
|
|
76
|
+
- SQL files stay separate from YAML
|
|
77
|
+
|
|
78
|
+
### `sql_database`
|
|
79
|
+
|
|
80
|
+
Use `dlt.sources.sql_database` in either:
|
|
81
|
+
- single-schema mode with `schema` + `tables`
|
|
82
|
+
- multi-schema mode with `schemas: {schema_name: {tables: [...]}}`
|
|
83
|
+
|
|
84
|
+
### `mongodb`
|
|
85
|
+
|
|
86
|
+
Use the bundled MongoDB runtime for:
|
|
87
|
+
- one or many collections
|
|
88
|
+
- optional collection filters and nesting control
|
|
89
|
+
- replace/append behavior through the manifest `run` section
|
|
90
|
+
|
|
91
|
+
## Private plugin UX
|
|
92
|
+
|
|
93
|
+
The public core is designed so private connectors can stay private without degrading developer experience.
|
|
94
|
+
|
|
95
|
+
### Option 1: local monorepo catalog
|
|
96
|
+
|
|
97
|
+
Point `dltaf` to a local plugin catalog:
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
export DLTAF_PLUGIN_PATHS="/path/to/monorepo/internal/dltaf_plugins"
|
|
101
|
+
dltaf plugins list
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
This is the softest rollout path when your private catalog still lives inside an existing monorepo.
|
|
105
|
+
|
|
106
|
+
### Option 2: importable plugin modules
|
|
107
|
+
|
|
108
|
+
Point `dltaf` to importable module names:
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
export DLTAF_PLUGIN_MODULES="company_private_plugins,team_connectors"
|
|
112
|
+
dltaf plugins list
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### Option 3: installed private packages
|
|
116
|
+
|
|
117
|
+
Install a private package that exposes entry points in the `dltaf.plugins` group. `dltaf` will discover them automatically.
|
|
118
|
+
|
|
119
|
+
### Plugin contract
|
|
120
|
+
|
|
121
|
+
Every plugin registers one or more `SourcePlugin` objects with:
|
|
122
|
+
- `kind`
|
|
123
|
+
- `validate(manifest)`
|
|
124
|
+
- `build_runtime_env(manifest)` if needed
|
|
125
|
+
- `run(manifest)`
|
|
126
|
+
|
|
127
|
+
Canonical recommendation for private kinds:
|
|
128
|
+
|
|
129
|
+
```text
|
|
130
|
+
internal.customer_export
|
|
131
|
+
internal.partner_events
|
|
132
|
+
company.some_connector
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### Scaffold a new plugin
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
dltaf scaffold plugin --kind internal.customer_export --output-dir ./internal/dltaf_plugins
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
## Airflow
|
|
142
|
+
|
|
143
|
+
`dltaf` ships Airflow helpers for:
|
|
144
|
+
- generating DAGs from manifests
|
|
145
|
+
- loading `run_manifest()` inside standard or virtualenv tasks
|
|
146
|
+
- propagating plugin paths, plugin modules, and plugin-specific requirements to isolated runtimes
|
|
147
|
+
|
|
148
|
+
Useful runtime environment variables:
|
|
149
|
+
- `DLTAF_PACKAGE_ROOT`
|
|
150
|
+
- `DLTAF_PLUGIN_PATHS`
|
|
151
|
+
- `DLTAF_PLUGIN_MODULES`
|
|
152
|
+
- `DLTAF_PLUGIN_REQUIREMENTS`
|
|
153
|
+
|
|
154
|
+
See the full guide in [GitHub Pages](https://paulkov.github.io/dltaf/airflow/).
|
|
155
|
+
|
|
156
|
+
## Vault integration
|
|
157
|
+
|
|
158
|
+
`dltaf` resolves manifest Vault references through `vault-kv-client`.
|
|
159
|
+
|
|
160
|
+
Supported reference forms:
|
|
161
|
+
- `vault://mount/path`
|
|
162
|
+
- `mount:path`
|
|
163
|
+
- mapping form with `mount_point`, `path`, and optional `kv_version`
|
|
164
|
+
|
|
165
|
+
This keeps the secrets contract stable across local runs, CI, and Airflow.
|
|
166
|
+
|
|
167
|
+
## Examples
|
|
168
|
+
|
|
169
|
+
The repository ships sanitized examples under `dltaf/examples/`:
|
|
170
|
+
- `smoke_oracle_custom_sql.yaml`
|
|
171
|
+
- `smoke_sql_database_catalog.yaml`
|
|
172
|
+
- `smoke_mongodb_catalog.yaml`
|
|
173
|
+
|
|
174
|
+
They are intentionally generic. Replace the sample Vault refs and connection settings with your own environment before running them against a live system.
|
|
175
|
+
|
|
176
|
+
## Documentation
|
|
177
|
+
|
|
178
|
+
Full docs live on GitHub Pages:
|
|
179
|
+
|
|
180
|
+
- Docs: https://paulkov.github.io/dltaf/
|
|
181
|
+
- Plugin guide: https://paulkov.github.io/dltaf/plugins/
|
|
182
|
+
- Airflow guide: https://paulkov.github.io/dltaf/airflow/
|
|
183
|
+
- Examples: https://paulkov.github.io/dltaf/examples/
|
|
184
|
+
|
|
185
|
+
## Development
|
|
186
|
+
|
|
187
|
+
Run the standard checks locally:
|
|
188
|
+
|
|
189
|
+
```bash
|
|
190
|
+
ruff check .
|
|
191
|
+
pytest
|
|
192
|
+
python -m build
|
|
193
|
+
mkdocs build
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
## License
|
|
197
|
+
|
|
198
|
+
Apache-2.0. See [LICENSE](LICENSE).
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"""CLI утилиты для управления dlt пайплайнами и Airflow DAG'ами.
|
|
2
|
+
|
|
3
|
+
Этот пакет содержит производственные command-line инструменты для работы с dlt:
|
|
4
|
+
- show_lineage: Визуализация и анализ зависимостей между пайплайнами (lineage graph)
|
|
5
|
+
- generate_dags: Автоматическая генерация Airflow DAG файлов из YAML манифестов
|
|
6
|
+
|
|
7
|
+
Примеры использования:
|
|
8
|
+
# Показать lineage (граф зависимостей пайплайнов)
|
|
9
|
+
python -m cli.show_lineage
|
|
10
|
+
python -m cli.show_lineage --format json # JSON формат для программной обработки
|
|
11
|
+
python -m cli.show_lineage --format mermaid # Mermaid диаграмма для визуализации
|
|
12
|
+
|
|
13
|
+
# Генерация Airflow DAG файлов из YAML манифестов
|
|
14
|
+
python -m cli.generate_dags # инкрементальная генерация
|
|
15
|
+
python -m cli.generate_dags --clean # удалить старые DAG'и, сгенерировать заново
|
|
16
|
+
|
|
17
|
+
# Через установленные CLI команды (после pip install -e .):
|
|
18
|
+
dlt-show-lineage
|
|
19
|
+
dlt-show-lineage --format mermaid
|
|
20
|
+
dlt-generate-dags --clean
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
__all__ = ["show_lineage", "generate_dags"]
|