strata-notebook 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.
Files changed (167) hide show
  1. strata_notebook-0.1.0/LICENSE +201 -0
  2. strata_notebook-0.1.0/PKG-INFO +354 -0
  3. strata_notebook-0.1.0/README.md +287 -0
  4. strata_notebook-0.1.0/pyproject.toml +221 -0
  5. strata_notebook-0.1.0/rust/Cargo.lock +1060 -0
  6. strata_notebook-0.1.0/rust/Cargo.toml +21 -0
  7. strata_notebook-0.1.0/rust/src/lib.rs +282 -0
  8. strata_notebook-0.1.0/src/strata/__init__.py +17 -0
  9. strata_notebook-0.1.0/src/strata/__main__.py +6 -0
  10. strata_notebook-0.1.0/src/strata/_frontend/assets/ConnectionsPanel-CZ55O8I4.css +1 -0
  11. strata_notebook-0.1.0/src/strata/_frontend/assets/ConnectionsPanel-nNv7748l.js +1 -0
  12. strata_notebook-0.1.0/src/strata/_frontend/assets/DagView-B3UiLJIu.css +1 -0
  13. strata_notebook-0.1.0/src/strata/_frontend/assets/DagView-DP-hb9Rf.js +1 -0
  14. strata_notebook-0.1.0/src/strata/_frontend/assets/EnvironmentPanel-Bi1apIVM.js +7 -0
  15. strata_notebook-0.1.0/src/strata/_frontend/assets/EnvironmentPanel-CiO1g1bC.css +1 -0
  16. strata_notebook-0.1.0/src/strata/_frontend/assets/ImpactPreview-BBt0Sa5K.js +1 -0
  17. strata_notebook-0.1.0/src/strata/_frontend/assets/ImpactPreview-D7K4fufy.css +1 -0
  18. strata_notebook-0.1.0/src/strata/_frontend/assets/InspectPanel-8PSoPu7X.js +1 -0
  19. strata_notebook-0.1.0/src/strata/_frontend/assets/InspectPanel-GUpTWHW9.css +1 -0
  20. strata_notebook-0.1.0/src/strata/_frontend/assets/InspectSwapConfirm-B-JrvEN8.js +1 -0
  21. strata_notebook-0.1.0/src/strata/_frontend/assets/InspectSwapConfirm-qbl06L3k.css +1 -0
  22. strata_notebook-0.1.0/src/strata/_frontend/assets/LlmPanel-CO6jgWsb.js +1 -0
  23. strata_notebook-0.1.0/src/strata/_frontend/assets/LlmPanel-DxZ3sOie.css +1 -0
  24. strata_notebook-0.1.0/src/strata/_frontend/assets/MountsPanel-DZCbmxNs.css +1 -0
  25. strata_notebook-0.1.0/src/strata/_frontend/assets/MountsPanel-g9qU02BE.js +1 -0
  26. strata_notebook-0.1.0/src/strata/_frontend/assets/NotebookPage-CCBe0-GL.css +1 -0
  27. strata_notebook-0.1.0/src/strata/_frontend/assets/NotebookPage-CD_ZF8sb.js +12 -0
  28. strata_notebook-0.1.0/src/strata/_frontend/assets/NotesPanel-CCMRVB-n.js +3 -0
  29. strata_notebook-0.1.0/src/strata/_frontend/assets/NotesPanel-CmBM3tZh.css +1 -0
  30. strata_notebook-0.1.0/src/strata/_frontend/assets/ProfilingPanel-BpLh0VvW.css +1 -0
  31. strata_notebook-0.1.0/src/strata/_frontend/assets/ProfilingPanel-LqGPHrfR.js +1 -0
  32. strata_notebook-0.1.0/src/strata/_frontend/assets/RuntimePanel-CPAigeTh.css +1 -0
  33. strata_notebook-0.1.0/src/strata/_frontend/assets/RuntimePanel-F0osryym.js +1 -0
  34. strata_notebook-0.1.0/src/strata/_frontend/assets/SchemaPanel-C9h_rN4e.css +1 -0
  35. strata_notebook-0.1.0/src/strata/_frontend/assets/SchemaPanel-NtV5WXH8.js +1 -0
  36. strata_notebook-0.1.0/src/strata/_frontend/assets/WorkersPanel-BvdbXRHI.css +1 -0
  37. strata_notebook-0.1.0/src/strata/_frontend/assets/WorkersPanel-vN_bSfo4.js +1 -0
  38. strata_notebook-0.1.0/src/strata/_frontend/assets/codemirror-vendor-BYs2OzBq.js +45 -0
  39. strata_notebook-0.1.0/src/strata/_frontend/assets/index-1LRi_2yf.js +21 -0
  40. strata_notebook-0.1.0/src/strata/_frontend/assets/index-CZubFOkf.css +1 -0
  41. strata_notebook-0.1.0/src/strata/_frontend/assets/notebook-Kxtv_l7y.js +1 -0
  42. strata_notebook-0.1.0/src/strata/_frontend/assets/rolldown-runtime-lhHHWwHU.js +1 -0
  43. strata_notebook-0.1.0/src/strata/_frontend/favicon.svg +1 -0
  44. strata_notebook-0.1.0/src/strata/_frontend/icons.svg +24 -0
  45. strata_notebook-0.1.0/src/strata/_frontend/index.html +20 -0
  46. strata_notebook-0.1.0/src/strata/_uv_runtime.py +46 -0
  47. strata_notebook-0.1.0/src/strata/adaptive_concurrency.py +530 -0
  48. strata_notebook-0.1.0/src/strata/artifact_store.py +1899 -0
  49. strata_notebook-0.1.0/src/strata/auth.py +251 -0
  50. strata_notebook-0.1.0/src/strata/blob_store.py +940 -0
  51. strata_notebook-0.1.0/src/strata/cache.py +631 -0
  52. strata_notebook-0.1.0/src/strata/cache_metrics.py +186 -0
  53. strata_notebook-0.1.0/src/strata/cache_stats.py +279 -0
  54. strata_notebook-0.1.0/src/strata/cache_warmer.py +416 -0
  55. strata_notebook-0.1.0/src/strata/circuit_breaker.py +361 -0
  56. strata_notebook-0.1.0/src/strata/cli.py +111 -0
  57. strata_notebook-0.1.0/src/strata/client.py +1758 -0
  58. strata_notebook-0.1.0/src/strata/config.py +830 -0
  59. strata_notebook-0.1.0/src/strata/duckdb_ext.py +19 -0
  60. strata_notebook-0.1.0/src/strata/executors.py +83 -0
  61. strata_notebook-0.1.0/src/strata/fast_io.py +413 -0
  62. strata_notebook-0.1.0/src/strata/fetcher.py +172 -0
  63. strata_notebook-0.1.0/src/strata/gc_tracker.py +292 -0
  64. strata_notebook-0.1.0/src/strata/health.py +445 -0
  65. strata_notebook-0.1.0/src/strata/iceberg.py +184 -0
  66. strata_notebook-0.1.0/src/strata/integration/__init__.py +54 -0
  67. strata_notebook-0.1.0/src/strata/integration/arrow.py +389 -0
  68. strata_notebook-0.1.0/src/strata/integration/datafusion.py +290 -0
  69. strata_notebook-0.1.0/src/strata/integration/duckdb.py +322 -0
  70. strata_notebook-0.1.0/src/strata/integration/pandas.py +201 -0
  71. strata_notebook-0.1.0/src/strata/integration/polars.py +285 -0
  72. strata_notebook-0.1.0/src/strata/json_types.py +5 -0
  73. strata_notebook-0.1.0/src/strata/logging.py +548 -0
  74. strata_notebook-0.1.0/src/strata/memory_profiler.py +383 -0
  75. strata_notebook-0.1.0/src/strata/metadata_cache.py +893 -0
  76. strata_notebook-0.1.0/src/strata/metadata_store.py +606 -0
  77. strata_notebook-0.1.0/src/strata/metrics.py +450 -0
  78. strata_notebook-0.1.0/src/strata/notebook/__init__.py +35 -0
  79. strata_notebook-0.1.0/src/strata/notebook/analyzer.py +685 -0
  80. strata_notebook-0.1.0/src/strata/notebook/annotation_validation.py +697 -0
  81. strata_notebook-0.1.0/src/strata/notebook/annotations.py +501 -0
  82. strata_notebook-0.1.0/src/strata/notebook/artifact_integration.py +345 -0
  83. strata_notebook-0.1.0/src/strata/notebook/cascade.py +189 -0
  84. strata_notebook-0.1.0/src/strata/notebook/causality.py +323 -0
  85. strata_notebook-0.1.0/src/strata/notebook/cli.py +537 -0
  86. strata_notebook-0.1.0/src/strata/notebook/dag.py +495 -0
  87. strata_notebook-0.1.0/src/strata/notebook/dependencies.py +1053 -0
  88. strata_notebook-0.1.0/src/strata/notebook/display/__init__.py +18 -0
  89. strata_notebook-0.1.0/src/strata/notebook/display/runtime.py +122 -0
  90. strata_notebook-0.1.0/src/strata/notebook/env.py +185 -0
  91. strata_notebook-0.1.0/src/strata/notebook/env_backend.py +258 -0
  92. strata_notebook-0.1.0/src/strata/notebook/executor.py +2918 -0
  93. strata_notebook-0.1.0/src/strata/notebook/export.py +859 -0
  94. strata_notebook-0.1.0/src/strata/notebook/harness.py +375 -0
  95. strata_notebook-0.1.0/src/strata/notebook/immutability.py +244 -0
  96. strata_notebook-0.1.0/src/strata/notebook/impact.py +178 -0
  97. strata_notebook-0.1.0/src/strata/notebook/inspect_repl.py +457 -0
  98. strata_notebook-0.1.0/src/strata/notebook/jupyter_import.py +1140 -0
  99. strata_notebook-0.1.0/src/strata/notebook/llm/__init__.py +93 -0
  100. strata_notebook-0.1.0/src/strata/notebook/llm/agent.py +923 -0
  101. strata_notebook-0.1.0/src/strata/notebook/llm/client.py +208 -0
  102. strata_notebook-0.1.0/src/strata/notebook/llm/config.py +177 -0
  103. strata_notebook-0.1.0/src/strata/notebook/llm/context.py +98 -0
  104. strata_notebook-0.1.0/src/strata/notebook/llm/prompts.py +215 -0
  105. strata_notebook-0.1.0/src/strata/notebook/llm/structured.py +198 -0
  106. strata_notebook-0.1.0/src/strata/notebook/models.py +723 -0
  107. strata_notebook-0.1.0/src/strata/notebook/module_export.py +609 -0
  108. strata_notebook-0.1.0/src/strata/notebook/mounts.py +658 -0
  109. strata_notebook-0.1.0/src/strata/notebook/parser.py +308 -0
  110. strata_notebook-0.1.0/src/strata/notebook/pool.py +306 -0
  111. strata_notebook-0.1.0/src/strata/notebook/pool_worker.py +316 -0
  112. strata_notebook-0.1.0/src/strata/notebook/process_tree.py +158 -0
  113. strata_notebook-0.1.0/src/strata/notebook/prompt_analyzer.py +170 -0
  114. strata_notebook-0.1.0/src/strata/notebook/prompt_executor.py +518 -0
  115. strata_notebook-0.1.0/src/strata/notebook/provenance.py +122 -0
  116. strata_notebook-0.1.0/src/strata/notebook/python_versions.py +187 -0
  117. strata_notebook-0.1.0/src/strata/notebook/remote_bundle.py +251 -0
  118. strata_notebook-0.1.0/src/strata/notebook/remote_executor.py +786 -0
  119. strata_notebook-0.1.0/src/strata/notebook/routes.py +3293 -0
  120. strata_notebook-0.1.0/src/strata/notebook/runtime_state.py +209 -0
  121. strata_notebook-0.1.0/src/strata/notebook/secret_manager/__init__.py +39 -0
  122. strata_notebook-0.1.0/src/strata/notebook/secret_manager/infisical.py +121 -0
  123. strata_notebook-0.1.0/src/strata/notebook/secret_manager/provider.py +63 -0
  124. strata_notebook-0.1.0/src/strata/notebook/secret_manager/registry.py +38 -0
  125. strata_notebook-0.1.0/src/strata/notebook/secret_manager/session_integration.py +97 -0
  126. strata_notebook-0.1.0/src/strata/notebook/serializer.py +1427 -0
  127. strata_notebook-0.1.0/src/strata/notebook/session.py +2575 -0
  128. strata_notebook-0.1.0/src/strata/notebook/sql/__init__.py +52 -0
  129. strata_notebook-0.1.0/src/strata/notebook/sql/adapter.py +262 -0
  130. strata_notebook-0.1.0/src/strata/notebook/sql/analyzer.py +376 -0
  131. strata_notebook-0.1.0/src/strata/notebook/sql/bind.py +135 -0
  132. strata_notebook-0.1.0/src/strata/notebook/sql/cell_executor.py +1016 -0
  133. strata_notebook-0.1.0/src/strata/notebook/sql/drivers/__init__.py +62 -0
  134. strata_notebook-0.1.0/src/strata/notebook/sql/drivers/bigquery.py +502 -0
  135. strata_notebook-0.1.0/src/strata/notebook/sql/drivers/duckdb.py +447 -0
  136. strata_notebook-0.1.0/src/strata/notebook/sql/drivers/postgresql.py +509 -0
  137. strata_notebook-0.1.0/src/strata/notebook/sql/drivers/snowflake.py +648 -0
  138. strata_notebook-0.1.0/src/strata/notebook/sql/drivers/sqlite.py +461 -0
  139. strata_notebook-0.1.0/src/strata/notebook/sql/provenance.py +350 -0
  140. strata_notebook-0.1.0/src/strata/notebook/sql/registry.py +68 -0
  141. strata_notebook-0.1.0/src/strata/notebook/timing.py +47 -0
  142. strata_notebook-0.1.0/src/strata/notebook/workers.py +867 -0
  143. strata_notebook-0.1.0/src/strata/notebook/writer.py +1188 -0
  144. strata_notebook-0.1.0/src/strata/notebook/ws.py +2272 -0
  145. strata_notebook-0.1.0/src/strata/planner.py +475 -0
  146. strata_notebook-0.1.0/src/strata/polars_ext.py +17 -0
  147. strata_notebook-0.1.0/src/strata/pool_metrics.py +297 -0
  148. strata_notebook-0.1.0/src/strata/py.typed +0 -0
  149. strata_notebook-0.1.0/src/strata/rate_limiter.py +299 -0
  150. strata_notebook-0.1.0/src/strata/server.py +6267 -0
  151. strata_notebook-0.1.0/src/strata/slow_ops.py +398 -0
  152. strata_notebook-0.1.0/src/strata/tenant.py +181 -0
  153. strata_notebook-0.1.0/src/strata/tenant_acl.py +289 -0
  154. strata_notebook-0.1.0/src/strata/tenant_registry.py +286 -0
  155. strata_notebook-0.1.0/src/strata/tracing.py +220 -0
  156. strata_notebook-0.1.0/src/strata/transforms/__init__.py +75 -0
  157. strata_notebook-0.1.0/src/strata/transforms/base.py +227 -0
  158. strata_notebook-0.1.0/src/strata/transforms/build_metrics.py +649 -0
  159. strata_notebook-0.1.0/src/strata/transforms/build_qos.py +587 -0
  160. strata_notebook-0.1.0/src/strata/transforms/build_store.py +817 -0
  161. strata_notebook-0.1.0/src/strata/transforms/duckdb_sql.py +158 -0
  162. strata_notebook-0.1.0/src/strata/transforms/reference_executor.py +489 -0
  163. strata_notebook-0.1.0/src/strata/transforms/registry.py +243 -0
  164. strata_notebook-0.1.0/src/strata/transforms/runner.py +973 -0
  165. strata_notebook-0.1.0/src/strata/transforms/scan.py +147 -0
  166. strata_notebook-0.1.0/src/strata/transforms/signed_urls.py +450 -0
  167. strata_notebook-0.1.0/src/strata/types.py +1345 -0
@@ -0,0 +1,201 @@
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, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated 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 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
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date 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
95
+ Derivative Works 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, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,354 @@
1
+ Metadata-Version: 2.4
2
+ Name: strata-notebook
3
+ Version: 0.1.0
4
+ Classifier: Development Status :: 3 - Alpha
5
+ Classifier: Intended Audience :: Developers
6
+ Classifier: License :: OSI Approved :: Apache Software License
7
+ Classifier: Programming Language :: Python :: 3
8
+ Classifier: Programming Language :: Python :: 3.12
9
+ Classifier: Programming Language :: Python :: 3.13
10
+ Classifier: Programming Language :: Python :: 3.14
11
+ Classifier: Programming Language :: Rust
12
+ Requires-Dist: pyiceberg[sql-sqlite,sql-postgres]>=0.8.0
13
+ Requires-Dist: pyarrow>=18.0.0
14
+ Requires-Dist: fastapi>=0.115.0
15
+ Requires-Dist: uvicorn>=0.32.0
16
+ Requires-Dist: websockets>=13.0
17
+ Requires-Dist: httpx>=0.28.0
18
+ Requires-Dist: duckdb>=1.1.0
19
+ Requires-Dist: python-multipart>=0.0.9
20
+ Requires-Dist: pydantic>=2.0.0
21
+ Requires-Dist: pydantic-settings>=2.0.0
22
+ Requires-Dist: tomli-w>=1.0.0
23
+ Requires-Dist: jsonschema>=4.0.0
24
+ Requires-Dist: infisicalsdk>=1.0.16
25
+ Requires-Dist: packaging>=24.0
26
+ Requires-Dist: azure-storage-blob>=12.20.0 ; extra == 'azure'
27
+ Requires-Dist: azure-identity>=1.15.0 ; extra == 'azure'
28
+ Requires-Dist: pandas>=2.0.0 ; extra == 'notebook'
29
+ Requires-Dist: numpy>=1.26.0 ; extra == 'notebook'
30
+ Requires-Dist: orjson>=3.10.0 ; extra == 'notebook'
31
+ Requires-Dist: cloudpickle>=3.0.0 ; extra == 'notebook'
32
+ Requires-Dist: matplotlib>=3.8.0 ; extra == 'notebook'
33
+ Requires-Dist: pillow>=10.0.0 ; extra == 'notebook'
34
+ Requires-Dist: opentelemetry-api>=1.20.0 ; extra == 'otel'
35
+ Requires-Dist: opentelemetry-sdk>=1.20.0 ; extra == 'otel'
36
+ Requires-Dist: opentelemetry-exporter-otlp>=1.20.0 ; extra == 'otel'
37
+ Requires-Dist: opentelemetry-instrumentation-fastapi>=0.41b0 ; extra == 'otel'
38
+ Requires-Dist: sqlglot>=25.0.0 ; extra == 'sql'
39
+ Requires-Dist: adbc-driver-manager>=1.0.0 ; extra == 'sql'
40
+ Requires-Dist: adbc-driver-bigquery>=1.0.0 ; extra == 'sql-bigquery'
41
+ Requires-Dist: duckdb>=1.0.0 ; extra == 'sql-duckdb'
42
+ Requires-Dist: adbc-driver-postgresql>=1.0.0 ; extra == 'sql-postgres'
43
+ Requires-Dist: adbc-driver-snowflake>=1.0.0 ; extra == 'sql-snowflake'
44
+ Requires-Dist: adbc-driver-sqlite>=1.0.0 ; extra == 'sql-sqlite'
45
+ Provides-Extra: azure
46
+ Provides-Extra: notebook
47
+ Provides-Extra: otel
48
+ Provides-Extra: sql
49
+ Provides-Extra: sql-bigquery
50
+ Provides-Extra: sql-duckdb
51
+ Provides-Extra: sql-postgres
52
+ Provides-Extra: sql-snowflake
53
+ Provides-Extra: sql-sqlite
54
+ License-File: LICENSE
55
+ Summary: A content-addressed computation graph with an interactive notebook UI
56
+ Keywords: iceberg,arrow,cache,analytics,duckdb
57
+ Author-email: Fangchen Li <fangchen.li@outlook.com>
58
+ License-Expression: Apache-2.0
59
+ Requires-Python: >=3.12
60
+ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
61
+ Project-URL: Changelog, https://github.com/bearing-research/strata/blob/main/CHANGELOG.md
62
+ Project-URL: Documentation, https://bearing-research.github.io/strata/
63
+ Project-URL: Homepage, https://bearing-research.github.io/strata/
64
+ Project-URL: Issues, https://github.com/bearing-research/strata/issues
65
+ Project-URL: Repository, https://github.com/bearing-research/strata
66
+
67
+ # Strata
68
+
69
+ [![PyPI](https://img.shields.io/pypi/v/strata-notebook.svg)](https://pypi.org/project/strata-notebook/)
70
+ [![Python versions](https://img.shields.io/pypi/pyversions/strata-notebook.svg)](https://pypi.org/project/strata-notebook/)
71
+ [![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/bearing-research/strata/blob/main/LICENSE)
72
+ [![CI](https://github.com/bearing-research/strata/actions/workflows/ci.yml/badge.svg)](https://github.com/bearing-research/strata/actions/workflows/ci.yml)
73
+ [![Pre-commit](https://github.com/bearing-research/strata/actions/workflows/pre-commit.yml/badge.svg)](https://github.com/bearing-research/strata/actions/workflows/pre-commit.yml)
74
+ [![Docker](https://github.com/bearing-research/strata/actions/workflows/docker.yml/badge.svg)](https://github.com/bearing-research/strata/actions/workflows/docker.yml)
75
+ [![Docs](https://github.com/bearing-research/strata/actions/workflows/docs.yml/badge.svg)](https://github.com/bearing-research/strata/actions/workflows/docs.yml)
76
+ [![codecov](https://codecov.io/gh/bearing-research/strata/branch/main/graph/badge.svg?token=GBAX34U2PO)](https://codecov.io/gh/bearing-research/strata)
77
+ [![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/bearing-research/strata/badge)](https://securityscorecards.dev/viewer/?uri=github.com/bearing-research/strata)
78
+
79
+ **Strata is a content-addressed computation graph with an interactive notebook UI.**
80
+
81
+ Every cell output is a versioned artifact keyed by its provenance: source,
82
+ inputs, and environment. Strata reads each cell's AST to build the
83
+ dependency graph automatically, so re-running a notebook is mostly a series
84
+ of cache hits. Touch one cell and the cascade re-executes only the cells
85
+ that depend on it. Identical inputs produce the same artifact whether the
86
+ second run comes a minute later or a year later, on the same machine or a
87
+ different one.
88
+
89
+ Prompt cells make AI calls first-class DAG nodes, cached by template,
90
+ inputs, and model config. `# @worker gpu-fly` dispatches a cell to a remote
91
+ GPU. `# @mount data s3://bucket/prefix ro` makes an S3 prefix available as a
92
+ local `pathlib.Path` inside the cell. The whole notebook is plain `.py`
93
+ files plus a manifest, so commits are git-diffable and there are no JSON
94
+ blobs or execution metadata bleeding into the history.
95
+
96
+ **Docs:** [bearing-research.github.io/strata](https://bearing-research.github.io/strata/)
97
+
98
+ ## Quick Start
99
+
100
+ Both paths below run in **personal mode**: single-user, writes enabled, no
101
+ proxy auth. For multi-tenant or hosted deployments, see
102
+ [Deployment Modes](https://bearing-research.github.io/strata/deployment/modes/).
103
+
104
+ ```bash
105
+ # Docker. docker-compose.yml sets personal mode for you.
106
+ docker compose up -d --build
107
+ # Then open http://localhost:8765
108
+
109
+ # Or via PyPI install (recommended) — requires uv. Drops the wheel into
110
+ # a uv-managed tool env at ~/.local/share/uv/tools/strata-notebook with
111
+ # the CLI on PATH.
112
+ uv tool install strata-notebook
113
+ strata-notebook
114
+ # Then open http://localhost:8765
115
+ ```
116
+
117
+ For the full inventory of installed commands (`strata-notebook`, `strata`,
118
+ `strata-worker`, `python -m strata`), see the
119
+ [Commands reference](https://bearing-research.github.io/strata/getting-started/installation/#commands-reference).
120
+
121
+ Source builds — `git clone + uv sync` — work too and are documented in
122
+ [Installation](https://bearing-research.github.io/strata/getting-started/installation/);
123
+ needed only if you're modifying Strata itself.
124
+
125
+ ### Requirements
126
+
127
+ - **[uv](https://docs.astral.sh/uv/) ≥ 0.8** — install via the
128
+ [uv installer](https://docs.astral.sh/uv/getting-started/installation/)
129
+ (`curl -LsSf https://astral.sh/uv/install.sh | sh` on macOS/Linux;
130
+ PowerShell installer on Windows). Strata refuses to start outside
131
+ a uv-managed environment: the startup check looks for the
132
+ `uv = <version>` marker that uv writes to `pyvenv.cfg`. `uv tool
133
+ install`, `uv add`, and `uv run` all produce envs with this
134
+ marker; plain `pip install` into a hand-rolled `python -m venv`
135
+ does not, and Strata will refuse to start there. Conda and
136
+ pip-venv users need to install uv and re-launch from a uv-managed
137
+ env — existing data and other environments are untouched. uv
138
+ fetches a matching Python for you, so you don't need Python
139
+ pre-installed.
140
+
141
+ Source build (only if you're building Strata itself from a git clone,
142
+ not using PyPI or Docker):
143
+
144
+ - **[Rust toolchain](https://rustup.rs/)** (rustup) — for `maturin`
145
+ to compile the native extension. PyPI wheels skip this step.
146
+ - **[Node 24+ / npm](https://nodejs.org/)** — for the frontend
147
+ `npm ci && npm run build` step. PyPI wheels bundle the prebuilt SPA.
148
+ - Python 3.12+ is handled automatically by `uv sync`.
149
+
150
+ Windows: PyPI install works directly. Source builds work via WSL2
151
+ (smoother) or native Windows (uv + rustup + Node have Windows
152
+ installers).
153
+
154
+ Why uv at runtime: the notebook subsystem shells out to `uv` to
155
+ manage per-notebook `.venv/` directories, and the project's dev
156
+ workflow assumes uv as the install path. Failing fast at startup with
157
+ a clear message beats a confusing subprocess error later.
158
+
159
+ ## Notebook Features
160
+
161
+ - **Content-addressed caching.** Same code plus same inputs equals an instant cache hit, zero recomputation.
162
+ - **Automatic dependency tracking.** DAG built from variable analysis, no manual wiring.
163
+ - **Cascade execution.** Change upstream code, downstream cells auto-invalidate.
164
+ - **Distributed workers.** Annotate `@worker gpu-fly` and the cell dispatches to a remote GPU.
165
+ - **Prompt cells.** LLM-powered cells with `{{ variable }}` template injection.
166
+ - **SQL cells.** First-class SQL cells with `# @sql connection=<name>`, named-bind parameters, and DuckDB / SQLite / PostgreSQL / Snowflake / BigQuery drivers.
167
+ - **AI assistant.** Streaming chat with conversation memory, agent mode for autonomous notebook building.
168
+ - **Environment management.** Per-notebook Python venvs via uv, isolated from each other.
169
+ - **Rich outputs.** DataFrames, matplotlib plots, markdown, images.
170
+ - **Cell operations.** Reorder, duplicate, fold, keyboard shortcuts.
171
+ - **Headless runner.** `strata run ./my-notebook` for CI and scheduled execution.
172
+
173
+ ## The Cache Advantage
174
+
175
+ Every notebook platform re-executes from scratch when you change one cell.
176
+ Strata doesn't. The artifact store deduplicates by provenance hash. If
177
+ the code and inputs haven't changed, the result is served instantly.
178
+
179
+ ```
180
+ First run: load data (10s) → clean (3s) → train (20s) → evaluate (1s) = 34s
181
+ Change model: load data (✓) → clean (✓) → train (20s) → evaluate (1s) = 21s
182
+ Re-run: load data (✓) → clean (✓) → train (✓) → evaluate (✓) = <1s
183
+ ```
184
+
185
+ This isn't a feature bolted on. It's the architecture. Every cell
186
+ execution is a `materialize(inputs, transform, environment) → artifact` operation,
187
+ and the cache is correct by construction because it's keyed on content,
188
+ not time.
189
+
190
+ ## Distributed Execution
191
+
192
+ Each cell can declare which worker it runs on via a single annotation:
193
+
194
+ ```python
195
+ # @worker my-gpu
196
+ embeddings = model.encode(abstracts, batch_size=256)
197
+ ```
198
+
199
+ You define workers in `notebook.toml`. Each one points at an HTTP
200
+ endpoint that implements the Strata executor protocol. A worker can be
201
+ a GPU box on RunPod, a DataFusion cluster on Fly, a beefy EC2 instance,
202
+ or anything else that speaks HTTP. The notebook routes the cell to the
203
+ declared worker at execution time, and the UI shows a live
204
+ "dispatching to my-gpu" badge while it runs.
205
+
206
+ No deployment code, no infrastructure glue. Bring your own compute,
207
+ one annotation per cell.
208
+
209
+ ## Source Annotations
210
+
211
+ Every piece of per-cell metadata is a comment directive in the cell's
212
+ source. The source is the single canonical place for cell config:
213
+ annotations always win over any stored defaults.
214
+
215
+ ```python
216
+ # @name Extract embeddings
217
+ # @worker gpu-fly
218
+ # @timeout 600
219
+ # @env MODEL_PATH=/models/bge-large
220
+ # @mount dataset s3://corpus/2024-q4 ro
221
+ embeddings = model.encode(dataset / "abstracts.jsonl")
222
+ ```
223
+
224
+ Diagnostics fire on open, reload, and after an edit settles:
225
+ `worker_unknown`, `mount_uri_unsupported`, `mount_shadows_notebook`,
226
+ `timeout_not_numeric`, `env_malformed`. They surface as a pill in the
227
+ cell header and log structured warnings for headless runs.
228
+
229
+ ## Mounts
230
+
231
+ Mounts bind a remote URI to a local path inside the cell. Supported
232
+ schemes: `file://`, `s3://`, `gs://`, `az://`. Credentials flow through
233
+ fsspec options: set `anon = true` for public buckets, or drop it to
234
+ use the standard credential chain.
235
+
236
+ ```toml
237
+ [[mounts]]
238
+ name = "taxi_zones"
239
+ uri = "s3://nyc-tlc/misc"
240
+ mode = "ro"
241
+ options = { anon = true }
242
+ ```
243
+
244
+ Inside the cell, `taxi_zones` is a `pathlib.Path`. Strata materializes
245
+ it on first read and caches the bytes locally for the session.
246
+
247
+ ## Examples
248
+
249
+ | Example | What it shows |
250
+ | --------------------------------------------------- | ----------------------------------------------------------------------------------- |
251
+ | [pandas_basics](https://bearing-research.github.io/strata/examples/pandas_basics/) | Linear DataFrame chain, caching, staleness propagation |
252
+ | [iris_classification](https://bearing-research.github.io/strata/examples/iris_classification/) | End-to-end ML, DAG branching, mixed output types |
253
+ | [titanic_ml](https://bearing-research.github.io/strata/examples/titanic_ml/) | Feature engineering + model comparison |
254
+ | [s3_mount](https://bearing-research.github.io/strata/examples/s3_mount/) | Reading a public S3 bucket via a mount |
255
+ | [arxiv_classifier](https://bearing-research.github.io/strata/examples/arxiv_classifier/) | Distributed execution via `@worker` + Modal GPU + Fly cluster |
256
+ | [markdown_showcase](https://bearing-research.github.io/strata/examples/markdown_showcase/) | Markdown cells, dynamic `Markdown(...)` outputs, security cases |
257
+ | [library_cells](https://bearing-research.github.io/strata/examples/library_cells/) | Cross-cell library code: pure module cells, mixed runtime+library cells, the limits |
258
+ | [news_alpha_trader](https://bearing-research.github.io/strata/examples/news_alpha_trader/) | Multi-stage trading pipeline with prompt cells and structured LLM outputs |
259
+
260
+ ## Known rough edges
261
+
262
+ Strata is at 0.1 and a few surfaces are explicitly exploratory. The core
263
+ (materialization, artifact store, DAG, caching, headless run) is stable
264
+ in the alpha sense; these are the bits where the API or coverage is
265
+ still moving:
266
+
267
+ - **Prompt-cell API.** Streaming, conversation memory, and structured-output
268
+ validation are not yet finalized — expect breaking changes in 0.x.
269
+ - **SQL cell cloud drivers.** DuckDB / SQLite / PostgreSQL are exercised
270
+ in CI. BigQuery and Snowflake adapters ship but lack integration test
271
+ coverage; pin a Strata version in production until that lands.
272
+ MotherDuck and MySQL are planned but not yet implemented.
273
+ - **Wire / on-disk formats.** `notebook.toml`, `runtime.json`, and the
274
+ artifact cache layout may change between minor versions during 0.x.
275
+ Rely on the Python API surface, not the file shapes.
276
+
277
+ ---
278
+
279
+ ## Library usage
280
+
281
+ Strata's HTTP API exposes the materialization layer directly,
282
+ driveable from Python via `StrataClient`. Useful for direct table
283
+ scans, custom transforms, and headless workflows; the notebook
284
+ executor is a separate pipeline that writes to the same artifact
285
+ store. The client talks to a running Strata server, so this workflow
286
+ has two steps: start the server, then call it from your code.
287
+
288
+ ```bash
289
+ # 1. Install + start the server (in a uv-managed env).
290
+ uv tool install strata-notebook
291
+ strata-notebook
292
+
293
+ # 2. From another process, point the client at it:
294
+ ```
295
+
296
+ ```python
297
+ from strata import StrataClient
298
+
299
+ client = StrataClient(base_url="http://localhost:8765")
300
+ artifact = client.materialize(
301
+ inputs=["file:///warehouse#db.events"],
302
+ transform={"executor": "scan@v1", "params": {"columns": ["id", "value"]}},
303
+ )
304
+ table = client.fetch(artifact.uri) # Arrow table, cached by provenance
305
+ ```
306
+
307
+ The server provides: provenance-based deduplication, immutable
308
+ versioned artifacts, lineage tracking, Iceberg table scanning with
309
+ row-group caching, pluggable blob storage (local/S3/GCS/Azure),
310
+ multi-tenancy, trusted-proxy auth, and an executor protocol for
311
+ external compute.
312
+
313
+ **[Library docs →](https://bearing-research.github.io/strata/getting-started/core/)**
314
+
315
+ ---
316
+
317
+ ## Architecture
318
+
319
+ ```
320
+ ┌─────────────────────────────────────────────┐
321
+ │ Notebook UI (Vue.js + WebSocket) │
322
+ │ cells, DAG view, AI assistant, workers │
323
+ └─────────────────────────────────────────────┘
324
+
325
+
326
+ ┌─────────────────────────────────────────────┐
327
+ │ Notebook Backend (FastAPI) │
328
+ │ session, cascade, executor, prompt cells │
329
+ └─────────────────────────────────────────────┘
330
+
331
+
332
+ ┌─────────────────────────────────────────────┐
333
+ │ Strata Core │
334
+ │ materialize, artifacts, lineage, dedupe │
335
+ └─────────────────────────────────────────────┘
336
+ ```
337
+
338
+ The notebook is an orchestration layer over Core. It decides what to
339
+ run next (cascade planning, staleness tracking). The cell harness is an
340
+ executor. Core decides whether results already exist and persists them.
341
+
342
+ ## Development
343
+
344
+ ```bash
345
+ uv sync # Install deps + build Rust extension
346
+ uv run pytest # Run all tests
347
+ uv run pre-commit run --all-files # Lint + format
348
+ cd frontend && npm run dev # Frontend dev server (hot reload)
349
+ ```
350
+
351
+ ## License
352
+
353
+ Apache 2.0
354
+