dcf-core 0.1.1__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.
Files changed (56) hide show
  1. dcf_core-0.1.1/LICENSE +184 -0
  2. dcf_core-0.1.1/PKG-INFO +206 -0
  3. dcf_core-0.1.1/README.md +209 -0
  4. dcf_core-0.1.1/dcf/__init__.py +4 -0
  5. dcf_core-0.1.1/dcf/cli.py +841 -0
  6. dcf_core-0.1.1/dcf/config/__init__.py +4 -0
  7. dcf_core-0.1.1/dcf/config/loader.py +77 -0
  8. dcf_core-0.1.1/dcf/config/models.py +240 -0
  9. dcf_core-0.1.1/dcf/engine/__init__.py +6 -0
  10. dcf_core-0.1.1/dcf/engine/fetcher.py +118 -0
  11. dcf_core-0.1.1/dcf/engine/iterator.py +96 -0
  12. dcf_core-0.1.1/dcf/engine/projector.py +56 -0
  13. dcf_core-0.1.1/dcf/engine/runner.py +90 -0
  14. dcf_core-0.1.1/dcf/engine/transforms.py +41 -0
  15. dcf_core-0.1.1/dcf/gcp/__init__.py +0 -0
  16. dcf_core-0.1.1/dcf/gcp/_collector_utils.py +87 -0
  17. dcf_core-0.1.1/dcf/gcp/auth.py +1 -0
  18. dcf_core-0.1.1/dcf/gcp/batch_deploy.py +548 -0
  19. dcf_core-0.1.1/dcf/gcp/bootstrap.py +131 -0
  20. dcf_core-0.1.1/dcf/gcp/gcloud.py +42 -0
  21. dcf_core-0.1.1/dcf/gcp/terraform.py +151 -0
  22. dcf_core-0.1.1/dcf/infra/modules/batch_collector/gcp/airflow/main.tf +194 -0
  23. dcf_core-0.1.1/dcf/infra/modules/batch_collector/gcp/airflow/outputs.tf +9 -0
  24. dcf_core-0.1.1/dcf/infra/modules/batch_collector/gcp/airflow/variables.tf +52 -0
  25. dcf_core-0.1.1/dcf/infra/modules/batch_collector/gcp/main.tf +70 -0
  26. dcf_core-0.1.1/dcf/infra/modules/batch_collector/gcp/outputs.tf +4 -0
  27. dcf_core-0.1.1/dcf/infra/modules/batch_collector/gcp/variables.tf +40 -0
  28. dcf_core-0.1.1/dcf/infra/modules/batch_collector/local/airflow/main.tf +64 -0
  29. dcf_core-0.1.1/dcf/infra/modules/batch_collector/local/airflow/outputs.tf +9 -0
  30. dcf_core-0.1.1/dcf/infra/modules/batch_collector/local/airflow/variables.tf +59 -0
  31. dcf_core-0.1.1/dcf/infra/modules/batch_collector/local/main.tf +32 -0
  32. dcf_core-0.1.1/dcf/infra/modules/batch_collector/local/outputs.tf +4 -0
  33. dcf_core-0.1.1/dcf/infra/modules/batch_collector/local/variables.tf +25 -0
  34. dcf_core-0.1.1/dcf/infra/templates/airflow.Dockerfile.tftpl +6 -0
  35. dcf_core-0.1.1/dcf/infra/templates/batch_collector.Dockerfile.tftpl +14 -0
  36. dcf_core-0.1.1/dcf/infra/templates/docker-compose.yml.tftpl +76 -0
  37. dcf_core-0.1.1/dcf/local_deploy.py +756 -0
  38. dcf_core-0.1.1/dcf/project.py +23 -0
  39. dcf_core-0.1.1/dcf/spark_session.py +66 -0
  40. dcf_core-0.1.1/dcf/warehouse_reader.py +323 -0
  41. dcf_core-0.1.1/dcf/writer/__init__.py +3 -0
  42. dcf_core-0.1.1/dcf/writer/iceberg.py +315 -0
  43. dcf_core-0.1.1/dcf_core.egg-info/PKG-INFO +206 -0
  44. dcf_core-0.1.1/dcf_core.egg-info/SOURCES.txt +54 -0
  45. dcf_core-0.1.1/dcf_core.egg-info/dependency_links.txt +1 -0
  46. dcf_core-0.1.1/dcf_core.egg-info/entry_points.txt +2 -0
  47. dcf_core-0.1.1/dcf_core.egg-info/requires.txt +15 -0
  48. dcf_core-0.1.1/dcf_core.egg-info/top_level.txt +1 -0
  49. dcf_core-0.1.1/pyproject.toml +39 -0
  50. dcf_core-0.1.1/setup.cfg +4 -0
  51. dcf_core-0.1.1/tests/test_deploy_cli.py +148 -0
  52. dcf_core-0.1.1/tests/test_deploy_model.py +83 -0
  53. dcf_core-0.1.1/tests/test_fetcher.py +69 -0
  54. dcf_core-0.1.1/tests/test_runner_errors.py +106 -0
  55. dcf_core-0.1.1/tests/test_transforms.py +38 -0
  56. dcf_core-0.1.1/tests/test_warehouse_reader.py +300 -0
dcf_core-0.1.1/LICENSE ADDED
@@ -0,0 +1,184 @@
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,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship made available under
36
+ the License, as indicated by a copyright notice that is included in
37
+ or attached to the work (an example is provided in the Appendix below).
38
+
39
+ "Derivative Works" shall mean any work, whether in Source or Object
40
+ form, that is based on (or derived from) the Work and for which the
41
+ editorial revisions, annotations, elaborations, or other transformations
42
+ represent, as a whole, an original work of authorship. For the purposes
43
+ of this License, Derivative Works shall not include works that remain
44
+ separable from, or merely link (or bind by name) to the interfaces of,
45
+ the Work and Derivative Works thereof.
46
+
47
+ "Contribution" shall mean, as submitted to the Licensor for inclusion
48
+ in the Work by the copyright owner or by an individual or Legal Entity
49
+ authorized to submit on behalf of the copyright owner. For the purposes
50
+ of this definition, "submit" means any form of electronic, verbal, or
51
+ written communication sent to the Licensor or its representatives,
52
+ including but not limited to communication on electronic mailing lists,
53
+ source code control systems, and issue tracking systems that are managed
54
+ by, or on behalf of, the Licensor for the purpose of discussing and
55
+ improving the Work, but excluding communication that is conspicuously
56
+ marked or designated in writing by the copyright owner as "Not a
57
+ Contribution."
58
+
59
+ "Contributor" shall mean Licensor and any Legal Entity on behalf of
60
+ whom a Contribution has been received by the Licensor and included
61
+ within the Work.
62
+
63
+ 2. Grant of Copyright License. Subject to the terms and conditions of
64
+ this License, each Contributor hereby grants to You a perpetual,
65
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
66
+ copyright license to reproduce, prepare Derivative Works of,
67
+ publicly display, publicly perform, sublicense, and distribute the
68
+ Work and such Derivative Works in Source or Object form.
69
+
70
+ 3. Grant of Patent License. Subject to the terms and conditions of
71
+ this License, each Contributor hereby grants to You a perpetual,
72
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
73
+ (except as stated in this section) patent license to make, have made,
74
+ use, offer to sell, sell, import, and otherwise transfer the Work,
75
+ where such license applies only to those patent claims licensable
76
+ by such Contributor that are necessarily infringed by their
77
+ Contribution(s) alone or by the combination of their Contribution(s)
78
+ with the Work to which such Contribution(s) was submitted. If You
79
+ institute patent litigation against any entity (including a cross-claim
80
+ or counterclaim in a lawsuit) alleging that the Work or/or a
81
+ Contribution incorporated within the Work constitutes direct or
82
+ contributory patent infringement, then any patent licenses granted to
83
+ You under this License for that Work shall terminate as of the date
84
+ such litigation is filed.
85
+
86
+ 4. Redistribution. You may reproduce and distribute copies of the
87
+ Work or Derivative Works thereof in any medium, with or without
88
+ modifications, and in Source or Object form, provided that You
89
+ meet the following conditions:
90
+
91
+ (a) You must give any other recipients of the Work or Derivative Works
92
+ a copy of this License; and
93
+
94
+ (b) You must cause any modified files to carry prominent notices
95
+ stating that You changed the files; and
96
+
97
+ (c) You must retain, in the Source form of any Derivative Works
98
+ that You distribute, all copyright, patent, trademark, and
99
+ attribution notices from the Source form of the Work,
100
+ excluding those notices that do not pertain to any part of
101
+ the Derivative Works; and
102
+
103
+ (d) If the Work includes a "NOTICE" text file as part of its
104
+ distribution, You must include a readable copy of the
105
+ attribution notices contained within such NOTICE file, in
106
+ at least one of the following places: within a NOTICE text file
107
+ distributed as part of the Derivative Works; within the Source
108
+ form or documentation, if provided along with the Derivative Works;
109
+ or, within a display generated by the Derivative Works, if and
110
+ wherever such third-party notices normally appear. The contents
111
+ of the NOTICE file are for informational purposes only and
112
+ do not modify the License. You may add Your own attribution
113
+ notices within Derivative Works that You distribute, alongside
114
+ or as an addendum to the NOTICE text from the Work, provided
115
+ that such additional attribution notices cannot be construed
116
+ as modifying the License.
117
+
118
+ You may add Your own license statement for Your modifications and
119
+ may provide additional grant of rights to use, copy, modify, merge,
120
+ publish, distribute, sublicense, and/or sell copies of the
121
+ Derivative Works, and to permit persons to whom the Derivative Works
122
+ is furnished to do so, subject to Your own terms and conditions.
123
+
124
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
125
+ any Contribution intentionally submitted for inclusion in the Work
126
+ by You to the Licensor shall be under the terms and conditions of
127
+ this License, without any additional terms or conditions.
128
+ Notwithstanding the above, nothing herein shall supersede or modify
129
+ the terms of any separate license agreement you may have executed
130
+ with Licensor regarding such Contributions.
131
+
132
+ 6. Trademarks. This License does not grant permission to use the trade
133
+ names, trademarks, service marks, or product names of the Licensor,
134
+ except as required for reasonable and customary use in describing the
135
+ origin of the Work and reproducing the content of the NOTICE file.
136
+
137
+ 7. Disclaimer of Warranty. Unless required by applicable law or
138
+ agreed to in writing, Licensor provides the Work (and each
139
+ Contributor provides its Contributions) on an "AS IS" BASIS,
140
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
141
+ implied, including, without limitation, any warranties or conditions
142
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
143
+ PARTICULAR PURPOSE. You are solely responsible for determining the
144
+ appropriateness of using or reproducing the Work and assume any
145
+ risks associated with Your exercise of permissions under this License.
146
+
147
+ 8. Limitation of Liability. In no event and under no legal theory,
148
+ whether in tort (including negligence), contract, or otherwise,
149
+ unless required by applicable law (such as deliberate and grossly
150
+ negligent acts) or agreed to in writing, shall any Contributor be
151
+ liable to You for damages, including any direct, indirect, special,
152
+ incidental, or exemplary damages of any character arising as a result
153
+ of this License or out of the use or inability to use the Work
154
+ (including but not limited to damages for loss of goodwill, work
155
+ stoppage, computer failure or malfunction, or all other commercial
156
+ damages or losses), even if such Contributor has been advised of the
157
+ possibility of such damages.
158
+
159
+ 9. Accepting Warranty or Liability. While redistributing the Work or
160
+ Derivative Works thereof, You may choose to offer, and charge a fee
161
+ for, acceptance of support, warranty, indemnity, or other liability
162
+ obligations and/or rights consistent with this License. However, in
163
+ accepting such obligations, You may offer such conditions only on
164
+ Your own behalf and on a solely responsible basis, not on behalf of
165
+ any other Contributor, and only if You agree to indemnify, defend,
166
+ and hold each Contributor harmless for any liability incurred by, or
167
+ claims asserted against, such Contributor by reason of your accepting
168
+ any such warranty or additional liability.
169
+
170
+ END OF TERMS AND CONDITIONS
171
+
172
+ Copyright 2026 Zeph Schafer
173
+
174
+ Licensed under the Apache License, Version 2.0 (the "License");
175
+ you may not use this file except in compliance with the License.
176
+ You may obtain a copy of the License at
177
+
178
+ http://www.apache.org/licenses/LICENSE-2.0
179
+
180
+ Unless required by applicable law or agreed to in writing, software
181
+ distributed under the License is distributed on an "AS IS" BASIS,
182
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
183
+ See the License for the specific language governing permissions and
184
+ limitations under the License.
@@ -0,0 +1,206 @@
1
+ Metadata-Version: 2.4
2
+ Name: dcf-core
3
+ Version: 0.1.1
4
+ License: Apache License
5
+ Version 2.0, January 2004
6
+ http://www.apache.org/licenses/
7
+
8
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
9
+
10
+ 1. Definitions.
11
+
12
+ "License" shall mean the terms and conditions for use, reproduction,
13
+ and distribution as defined by Sections 1 through 9 of this document.
14
+
15
+ "Licensor" shall mean the copyright owner or entity authorized by
16
+ the copyright owner that is granting the License.
17
+
18
+ "Legal Entity" shall mean the union of the acting entity and all
19
+ other entities that control, are controlled by, or are under common
20
+ control with that entity. For the purposes of this definition,
21
+ "control" means (i) the power, direct or indirect, to cause the
22
+ direction or management of such entity, whether by contract or
23
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
24
+ outstanding shares, or (iii) beneficial ownership of such entity.
25
+
26
+ "You" (or "Your") shall mean an individual or Legal Entity
27
+ exercising permissions granted by this License.
28
+
29
+ "Source" form shall mean the preferred form for making modifications,
30
+ including but not limited to software source code, documentation
31
+ source, and configuration files.
32
+
33
+ "Object" form shall mean any form resulting from mechanical
34
+ transformation or translation of a Source form, including but
35
+ not limited to compiled object code, generated documentation,
36
+ and conversions to other media types.
37
+
38
+ "Work" shall mean the work of authorship made available under
39
+ the License, as indicated by a copyright notice that is included in
40
+ or attached to the work (an example is provided in the Appendix below).
41
+
42
+ "Derivative Works" shall mean any work, whether in Source or Object
43
+ form, that is based on (or derived from) the Work and for which the
44
+ editorial revisions, annotations, elaborations, or other transformations
45
+ represent, as a whole, an original work of authorship. For the purposes
46
+ of this License, Derivative Works shall not include works that remain
47
+ separable from, or merely link (or bind by name) to the interfaces of,
48
+ the Work and Derivative Works thereof.
49
+
50
+ "Contribution" shall mean, as submitted to the Licensor for inclusion
51
+ in the Work by the copyright owner or by an individual or Legal Entity
52
+ authorized to submit on behalf of the copyright owner. For the purposes
53
+ of this definition, "submit" means any form of electronic, verbal, or
54
+ written communication sent to the Licensor or its representatives,
55
+ including but not limited to communication on electronic mailing lists,
56
+ source code control systems, and issue tracking systems that are managed
57
+ by, or on behalf of, the Licensor for the purpose of discussing and
58
+ improving the Work, but excluding communication that is conspicuously
59
+ marked or designated in writing by the copyright owner as "Not a
60
+ Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any Legal Entity on behalf of
63
+ whom a Contribution has been received by the Licensor and included
64
+ within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by the combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a cross-claim
83
+ or counterclaim in a lawsuit) alleging that the Work or/or a
84
+ Contribution incorporated within the Work constitutes direct or
85
+ contributory patent infringement, then any patent licenses granted to
86
+ You under this License for that Work shall terminate as of the date
87
+ such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or Derivative Works
95
+ a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, You must include a readable copy of the
108
+ attribution notices contained within such NOTICE file, in
109
+ at least one of the following places: within a NOTICE text file
110
+ distributed as part of the Derivative Works; within the Source
111
+ form or documentation, if provided along with the Derivative Works;
112
+ or, within a display generated by the Derivative Works, if and
113
+ wherever such third-party notices normally appear. The contents
114
+ of the NOTICE file are for informational purposes only and
115
+ do not modify the License. You may add Your own attribution
116
+ notices within Derivative Works that You distribute, alongside
117
+ or as an addendum to the NOTICE text from the Work, provided
118
+ that such additional attribution notices cannot be construed
119
+ as modifying the License.
120
+
121
+ You may add Your own license statement for Your modifications and
122
+ may provide additional grant of rights to use, copy, modify, merge,
123
+ publish, distribute, sublicense, and/or sell copies of the
124
+ Derivative Works, and to permit persons to whom the Derivative Works
125
+ is furnished to do so, subject to Your own terms and conditions.
126
+
127
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
128
+ any Contribution intentionally submitted for inclusion in the Work
129
+ by You to the Licensor shall be under the terms and conditions of
130
+ this License, without any additional terms or conditions.
131
+ Notwithstanding the above, nothing herein shall supersede or modify
132
+ the terms of any separate license agreement you may have executed
133
+ with Licensor regarding such Contributions.
134
+
135
+ 6. Trademarks. This License does not grant permission to use the trade
136
+ names, trademarks, service marks, or product names of the Licensor,
137
+ except as required for reasonable and customary use in describing the
138
+ origin of the Work and reproducing the content of the NOTICE file.
139
+
140
+ 7. Disclaimer of Warranty. Unless required by applicable law or
141
+ agreed to in writing, Licensor provides the Work (and each
142
+ Contributor provides its Contributions) on an "AS IS" BASIS,
143
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
144
+ implied, including, without limitation, any warranties or conditions
145
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
146
+ PARTICULAR PURPOSE. You are solely responsible for determining the
147
+ appropriateness of using or reproducing the Work and assume any
148
+ risks associated with Your exercise of permissions under this License.
149
+
150
+ 8. Limitation of Liability. In no event and under no legal theory,
151
+ whether in tort (including negligence), contract, or otherwise,
152
+ unless required by applicable law (such as deliberate and grossly
153
+ negligent acts) or agreed to in writing, shall any Contributor be
154
+ liable to You for damages, including any direct, indirect, special,
155
+ incidental, or exemplary damages of any character arising as a result
156
+ of this License or out of the use or inability to use the Work
157
+ (including but not limited to damages for loss of goodwill, work
158
+ stoppage, computer failure or malfunction, or all other commercial
159
+ damages or losses), even if such Contributor has been advised of the
160
+ possibility of such damages.
161
+
162
+ 9. Accepting Warranty or Liability. While redistributing the Work or
163
+ Derivative Works thereof, You may choose to offer, and charge a fee
164
+ for, acceptance of support, warranty, indemnity, or other liability
165
+ obligations and/or rights consistent with this License. However, in
166
+ accepting such obligations, You may offer such conditions only on
167
+ Your own behalf and on a solely responsible basis, not on behalf of
168
+ any other Contributor, and only if You agree to indemnify, defend,
169
+ and hold each Contributor harmless for any liability incurred by, or
170
+ claims asserted against, such Contributor by reason of your accepting
171
+ any such warranty or additional liability.
172
+
173
+ END OF TERMS AND CONDITIONS
174
+
175
+ Copyright 2026 Zeph Schafer
176
+
177
+ Licensed under the Apache License, Version 2.0 (the "License");
178
+ you may not use this file except in compliance with the License.
179
+ You may obtain a copy of the License at
180
+
181
+ http://www.apache.org/licenses/LICENSE-2.0
182
+
183
+ Unless required by applicable law or agreed to in writing, software
184
+ distributed under the License is distributed on an "AS IS" BASIS,
185
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
186
+ See the License for the specific language governing permissions and
187
+ limitations under the License.
188
+
189
+ Requires-Python: >=3.12
190
+ License-File: LICENSE
191
+ Requires-Dist: pyspark==4.0.2
192
+ Requires-Dist: pandas
193
+ Requires-Dist: requests
194
+ Requires-Dist: pyarrow
195
+ Requires-Dist: pytz
196
+ Requires-Dist: pydantic>=2
197
+ Requires-Dist: typer[all]>=0.9
198
+ Requires-Dist: google-auth>=2.29
199
+ Requires-Dist: google-cloud-storage>=2.16
200
+ Requires-Dist: google-cloud-secret-manager>=2.20
201
+ Requires-Dist: kafka-python>=2.0
202
+ Requires-Dist: google-api-python-client>=2.126
203
+ Requires-Dist: pyyaml>=6.0
204
+ Requires-Dist: mcp>=1.0
205
+ Requires-Dist: duckdb>=1.0
206
+ Dynamic: license-file
@@ -0,0 +1,209 @@
1
+ # dcf
2
+
3
+ D.ata C.ollection F.ramework
4
+
5
+ It works like this
6
+ 1. User defines collectors with basic configs in a YAML (like a dbt model)
7
+ 2. dcf builds and runs the collector
8
+ 3. Data lake has data
9
+
10
+ ## Quickstart
11
+
12
+ This guide walks you from zero to a working data collector. The example ingests your GitHub repositories.
13
+
14
+ ### 1. Create a project
15
+
16
+ dcf is a tool you depend on, not a repo you clone. Create a fresh directory:
17
+
18
+ ```bash
19
+ mkdir dcf-demo && cd dcf-demo
20
+ ```
21
+
22
+ **`pyproject.toml`:**
23
+
24
+ ```toml
25
+ [project]
26
+ name = "dcf-demo"
27
+ version = "0.1.0"
28
+ requires-python = ">=3.12"
29
+ dependencies = [
30
+ "dcf",
31
+ ]
32
+
33
+ [tool.uv]
34
+ package = false
35
+
36
+ [tool.uv.sources]
37
+ dcf = { git = "https://github.com/zephschafer/dcf.git" }
38
+ ```
39
+
40
+ **`project.yml`**
41
+
42
+ ```yaml
43
+ catalog: local
44
+ ```
45
+
46
+ **`.gitignore`:**
47
+
48
+ ```
49
+ warehouse/
50
+ project.yml
51
+ .venv/
52
+ __pycache__/
53
+ ```
54
+
55
+ ```bash
56
+ mkdir collectors
57
+ uv sync
58
+ ```
59
+
60
+ ---
61
+
62
+ ### 2. Write a collector
63
+
64
+ Create `collectors/dcf_commits.yml`:
65
+
66
+ ```yaml
67
+ name: dcf_commits
68
+ namespace: github
69
+ description: Commits to the dcf repository.
70
+
71
+ source:
72
+ type: http
73
+ url: https://api.github.com/repos/zephschafer/dcf/commits
74
+ method: GET
75
+ params:
76
+ - name: sha
77
+ type: string
78
+ value: main
79
+ - name: per_page
80
+ type: integer
81
+ value: 100
82
+ schema:
83
+ columns:
84
+ - {name: sha, path: sha, type: string}
85
+ - {name: author, path: commit.author.name, type: string}
86
+ - {name: message, path: commit.message, type: string}
87
+ - {name: committed_at, path: commit.author.date, type: timestamp}
88
+
89
+ cadence:
90
+ strategy: incremental
91
+ primary_key: sha
92
+
93
+ deployment:
94
+ schedule: "0 8 * * *"
95
+ ```
96
+
97
+ ---
98
+
99
+ ### 3. Validate
100
+
101
+ ```bash
102
+ uv run dcf validate dcf_commits
103
+ ```
104
+
105
+ ---
106
+
107
+ ### 4. Run
108
+
109
+ ```bash
110
+ uv run dcf run dcf_commits
111
+ ```
112
+
113
+ ---
114
+
115
+ ### 5. Query the warehouse
116
+
117
+ ```bash
118
+ uv run dcf query 'SELECT * FROM github.dcf_commits'
119
+ ```
120
+
121
+ You can also save your SQL to a file and run it with `--file`:
122
+
123
+ ```bash
124
+ uv run dcf query --file my_query.sql
125
+ ```
126
+
127
+ ---
128
+
129
+ ### 6. Deploy
130
+
131
+ ```bash
132
+ uv run dcf deploy dcf_commits
133
+ ```
134
+
135
+ This schedules the collector to run daily at 8 AM UTC, as configured in `deployment.schedule`.
136
+
137
+ ---
138
+
139
+ ## Developing dcf
140
+
141
+ Clone this repo, then create or point to a project for testing:
142
+
143
+ ```bash
144
+ git clone https://github.com/Data-Dispatch/dcf
145
+ cd dcf
146
+ uv sync
147
+
148
+ # Test against the demo project
149
+ git clone https://github.com/Data-Dispatch/quipu-data-generator ../quipu-data-generator
150
+ cd ../quipu-data-generator
151
+ uv sync # picks up dcf from ../dcf via editable path dep
152
+ uv run dcf validate all
153
+ ```
154
+
155
+ Or create a minimal test project:
156
+
157
+ ```bash
158
+ mkdir my-test-project && cd my-test-project
159
+ cat > pyproject.toml << 'EOF'
160
+ [project]
161
+ name = "my-test-project"
162
+ version = "0.1.0"
163
+ requires-python = ">=3.12"
164
+ dependencies = ["dcf"]
165
+
166
+ [tool.uv]
167
+ package = false
168
+
169
+ [tool.uv.sources]
170
+ dcf = { path = "../dcf", editable = true }
171
+ EOF
172
+
173
+ cat > project.yml << 'EOF'
174
+ catalog: local
175
+ EOF
176
+
177
+ mkdir collectors
178
+ uv sync
179
+ uv run dcf validate all # "OK — 0 collector(s)"
180
+ ```
181
+
182
+ ---
183
+
184
+ ## dcf package structure
185
+
186
+ ```
187
+ dcf/
188
+ ├── cli.py Entry point (Typer app)
189
+ ├── project.py Project root discovery (CWD walk / DCF_PROJECT_DIR)
190
+ ├── spark_session.py PySpark + Iceberg session factory
191
+ ├── mcp_server.py MCP server (FastMCP)
192
+ ├── warehouse_reader.py DuckDB-based warehouse query layer
193
+ ├── config/
194
+ │ ├── models.py Pydantic models for collector YAML
195
+ │ └── loader.py YAML loading + env var resolution
196
+ ├── engine/
197
+ │ ├── runner.py Outer loop (expand cadence → fetch → project → write)
198
+ │ ├── fetcher.py HTTP and Python source fetchers
199
+ │ ├── iterator.py Cartesian iteration over date ranges and categoricals
200
+ │ ├── projector.py Schema projection (path extraction, transforms)
201
+ │ └── transforms.py Column transforms (crs_reproject, etc.)
202
+ ├── writer/
203
+ │ └── iceberg.py Iceberg write strategies (incremental / append / full_refresh)
204
+ └── gcp/
205
+ ├── bootstrap.py GCS bucket + service account provisioning
206
+ ├── terraform.py Terraform wrapper for lake infrastructure
207
+ ├── auth.py GCP credential helpers
208
+ └── gcloud.py gcloud CLI wrappers
209
+ ```
@@ -0,0 +1,4 @@
1
+ from .engine.runner import run_collector
2
+ from .config import load_collector, load_all_collectors
3
+
4
+ __all__ = ["run_collector", "load_collector", "load_all_collectors"]