uptimely-core 0.1.0.dev0__tar.gz → 0.2.0.dev0__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 (149) hide show
  1. {uptimely_core-0.1.0.dev0 → uptimely_core-0.2.0.dev0}/PKG-INFO +23 -9
  2. {uptimely_core-0.1.0.dev0 → uptimely_core-0.2.0.dev0}/pyproject.toml +5 -5
  3. {uptimely_core-0.1.0.dev0 → uptimely_core-0.2.0.dev0}/readme.md +20 -6
  4. uptimely_core-0.2.0.dev0/src/uptimely/__init__.py +40 -0
  5. uptimely_core-0.2.0.dev0/src/uptimely/analytics/__init__.py +65 -0
  6. uptimely_core-0.2.0.dev0/src/uptimely/analytics/api.py +82 -0
  7. uptimely_core-0.2.0.dev0/src/uptimely/analytics/catalog.py +41 -0
  8. uptimely_core-0.2.0.dev0/src/uptimely/analytics/feature_graph/__init__.py +14 -0
  9. uptimely_core-0.1.0.dev0/src/uptimely/analytics/feature_graph.py → uptimely_core-0.2.0.dev0/src/uptimely/analytics/feature_graph/graph.py +133 -106
  10. {uptimely_core-0.1.0.dev0/src/uptimely/analytics → uptimely_core-0.2.0.dev0/src/uptimely/analytics/feature_graph}/models.py +16 -22
  11. uptimely_core-0.2.0.dev0/src/uptimely/analytics/json/__init__.py +1 -0
  12. uptimely_core-0.2.0.dev0/src/uptimely/analytics/json/codec.py +42 -0
  13. uptimely_core-0.2.0.dev0/src/uptimely/analytics/model/__init__.py +48 -0
  14. uptimely_core-0.2.0.dev0/src/uptimely/analytics/model/analytics.py +86 -0
  15. uptimely_core-0.2.0.dev0/src/uptimely/analytics/model/common.py +47 -0
  16. uptimely_core-0.2.0.dev0/src/uptimely/analytics/model/dataset.py +115 -0
  17. uptimely_core-0.2.0.dev0/src/uptimely/analytics/model/functions.py +57 -0
  18. uptimely_core-0.2.0.dev0/src/uptimely/analytics/python/__init__.py +7 -0
  19. uptimely_core-0.2.0.dev0/src/uptimely/analytics/python/analytics.py +60 -0
  20. uptimely_core-0.2.0.dev0/src/uptimely/analytics/python/bind.py +121 -0
  21. uptimely_core-0.2.0.dev0/src/uptimely/analytics/python/conversion.py +159 -0
  22. uptimely_core-0.2.0.dev0/src/uptimely/analytics/python/dataset.py +142 -0
  23. {uptimely_core-0.1.0.dev0/src/uptimely/spec/python_spec → uptimely_core-0.2.0.dev0/src/uptimely/analytics/python}/dimension.py +5 -5
  24. uptimely_core-0.2.0.dev0/src/uptimely/analytics/python/entity.py +35 -0
  25. uptimely_core-0.2.0.dev0/src/uptimely/analytics/python/feature.py +28 -0
  26. uptimely_core-0.2.0.dev0/src/uptimely/analytics/python/mappings.py +87 -0
  27. uptimely_core-0.2.0.dev0/src/uptimely/analytics/python/ref.py +139 -0
  28. uptimely_core-0.2.0.dev0/src/uptimely/analytics/python/row_context.py +165 -0
  29. uptimely_core-0.2.0.dev0/src/uptimely/analytics/references.py +147 -0
  30. uptimely_core-0.2.0.dev0/src/uptimely/analytics/resolution.py +78 -0
  31. uptimely_core-0.2.0.dev0/src/uptimely/analytics/resolved.py +60 -0
  32. uptimely_core-0.2.0.dev0/src/uptimely/analytics/validation/__init__.py +20 -0
  33. uptimely_core-0.2.0.dev0/src/uptimely/analytics/validation/analytics.py +40 -0
  34. uptimely_core-0.2.0.dev0/src/uptimely/analytics/validation/context.py +174 -0
  35. uptimely_core-0.2.0.dev0/src/uptimely/analytics/validation/dependencies.py +23 -0
  36. uptimely_core-0.2.0.dev0/src/uptimely/analytics/validation/dimensions.py +111 -0
  37. uptimely_core-0.2.0.dev0/src/uptimely/analytics/validation/errors.py +13 -0
  38. uptimely_core-0.2.0.dev0/src/uptimely/analytics/validation/functions.py +150 -0
  39. uptimely_core-0.2.0.dev0/src/uptimely/analytics/validation/mappings.py +434 -0
  40. uptimely_core-0.2.0.dev0/src/uptimely/analytics/validation/prepared.py +155 -0
  41. uptimely_core-0.2.0.dev0/src/uptimely/cli/analytics.py +97 -0
  42. uptimely_core-0.2.0.dev0/src/uptimely/cli/cli.py +39 -0
  43. uptimely_core-0.2.0.dev0/src/uptimely/cli/common.py +49 -0
  44. uptimely_core-0.2.0.dev0/src/uptimely/cli/engine.py +99 -0
  45. uptimely_core-0.1.0.dev0/src/uptimely/cli/cli.py → uptimely_core-0.2.0.dev0/src/uptimely/cli/examples.py +55 -43
  46. uptimely_core-0.2.0.dev0/src/uptimely/cli/explorer.py +192 -0
  47. uptimely_core-0.2.0.dev0/src/uptimely/cli/plan.py +64 -0
  48. uptimely_core-0.2.0.dev0/src/uptimely/compiler/__init__.py +12 -0
  49. uptimely_core-0.2.0.dev0/src/uptimely/compiler/callable_node.py +54 -0
  50. uptimely_core-0.2.0.dev0/src/uptimely/compiler/compiler.py +201 -0
  51. uptimely_core-0.2.0.dev0/src/uptimely/compiler/execution_graph.py +264 -0
  52. uptimely_core-0.2.0.dev0/src/uptimely/compiler/plan/__init__.py +6 -0
  53. uptimely_core-0.2.0.dev0/src/uptimely/compiler/plan/models.py +187 -0
  54. uptimely_core-0.2.0.dev0/src/uptimely/compiler/plan/serialization.py +16 -0
  55. uptimely_core-0.2.0.dev0/src/uptimely/contracts.py +56 -0
  56. {uptimely_core-0.1.0.dev0 → uptimely_core-0.2.0.dev0}/src/uptimely/engine/__init__.py +2 -2
  57. uptimely_core-0.2.0.dev0/src/uptimely/engine/backend.py +158 -0
  58. uptimely_core-0.2.0.dev0/src/uptimely/engine/bindings.py +80 -0
  59. uptimely_core-0.2.0.dev0/src/uptimely/engine/config.py +35 -0
  60. uptimely_core-0.2.0.dev0/src/uptimely/engine/dataframe.py +119 -0
  61. uptimely_core-0.2.0.dev0/src/uptimely/engine/engine.py +178 -0
  62. {uptimely_core-0.1.0.dev0 → uptimely_core-0.2.0.dev0}/src/uptimely/engine/result.py +6 -7
  63. uptimely_core-0.2.0.dev0/src/uptimely/engine/state.py +33 -0
  64. uptimely_core-0.2.0.dev0/src/uptimely/entrypoint.py +172 -0
  65. uptimely_core-0.2.0.dev0/src/uptimely/explorer/analytics_render.py +288 -0
  66. uptimely_core-0.2.0.dev0/src/uptimely/explorer/explorer.py +127 -0
  67. uptimely_core-0.2.0.dev0/src/uptimely/explorer/graph_render.py +131 -0
  68. uptimely_core-0.2.0.dev0/src/uptimely/explorer/lineage.py +162 -0
  69. uptimely_core-0.2.0.dev0/src/uptimely/explorer/plan_render.py +230 -0
  70. uptimely_core-0.2.0.dev0/src/uptimely/mcp/__init__.py +5 -0
  71. {uptimely_core-0.1.0.dev0 → uptimely_core-0.2.0.dev0}/src/uptimely/mcp/server.py +122 -95
  72. uptimely_core-0.2.0.dev0/src/uptimely/render.py +32 -0
  73. uptimely_core-0.2.0.dev0/src/uptimely/row_context.py +216 -0
  74. {uptimely_core-0.1.0.dev0/src/uptimely/spec → uptimely_core-0.2.0.dev0/src/uptimely}/storage.py +33 -16
  75. uptimely_core-0.2.0.dev0/src/uptimely/templates/analytics/datasets.html.j2 +5 -0
  76. uptimely_core-0.2.0.dev0/src/uptimely/templates/analytics/dimensions.html.j2 +5 -0
  77. uptimely_core-0.2.0.dev0/src/uptimely/templates/analytics/entities.html.j2 +5 -0
  78. uptimely_core-0.2.0.dev0/src/uptimely/templates/analytics/features.html.j2 +5 -0
  79. uptimely_core-0.2.0.dev0/src/uptimely/templates/analytics/functions.html.j2 +5 -0
  80. uptimely_core-0.2.0.dev0/src/uptimely/templates/analytics/index.html.j2 +26 -0
  81. uptimely_core-0.2.0.dev0/src/uptimely/templates/analytics/overview.html.j2 +5 -0
  82. uptimely_core-0.2.0.dev0/src/uptimely/templates/analytics/section_header.html.j2 +13 -0
  83. uptimely_core-0.2.0.dev0/src/uptimely/templates/analytics/sections/dataset_list.html.j2 +124 -0
  84. uptimely_core-0.2.0.dev0/src/uptimely/templates/analytics/sections/dimensions.html.j2 +17 -0
  85. uptimely_core-0.2.0.dev0/src/uptimely/templates/analytics/sections/entities.html.j2 +80 -0
  86. uptimely_core-0.2.0.dev0/src/uptimely/templates/analytics/sections/entity_list.html.j2 +39 -0
  87. uptimely_core-0.2.0.dev0/src/uptimely/templates/analytics/sections/functions.html.j2 +64 -0
  88. uptimely_core-0.2.0.dev0/src/uptimely/templates/analytics/sections/overview.html.j2 +42 -0
  89. uptimely_core-0.2.0.dev0/src/uptimely/templates/base.html.j2 +95 -0
  90. uptimely_core-0.2.0.dev0/src/uptimely/templates/execution/data_lineage.html.j2 +403 -0
  91. uptimely_core-0.2.0.dev0/src/uptimely/templates/graph/base.html.j2 +62 -0
  92. uptimely_core-0.2.0.dev0/src/uptimely/templates/graph/feature_graph.html.j2 +50 -0
  93. uptimely_core-0.2.0.dev0/src/uptimely/templates/graph/feature_graph_shared.html.j2 +49 -0
  94. uptimely_core-0.2.0.dev0/src/uptimely/templates/graph/feature_renderer_2d.js.j2 +259 -0
  95. uptimely_core-0.2.0.dev0/src/uptimely/templates/graph/feature_renderer_3d.js.j2 +60 -0
  96. uptimely_core-0.2.0.dev0/src/uptimely/templates/graph/view_controller.js.j2 +56 -0
  97. uptimely_core-0.2.0.dev0/src/uptimely/templates/graph/view_controls.html.j2 +10 -0
  98. uptimely_core-0.2.0.dev0/src/uptimely/templates/icons.html.j2 +17 -0
  99. uptimely_core-0.2.0.dev0/src/uptimely/templates/index.html.j2 +153 -0
  100. {uptimely_core-0.1.0.dev0/src/uptimely/compile/templates → uptimely_core-0.2.0.dev0/src/uptimely/templates/plan}/callable_graph.html.j2 +42 -36
  101. uptimely_core-0.2.0.dev0/src/uptimely/templates/plan/callable_renderer_2d.js.j2 +124 -0
  102. uptimely_core-0.2.0.dev0/src/uptimely/templates/plan/graph.html.j2 +6 -0
  103. uptimely_core-0.2.0.dev0/src/uptimely/templates/plan/index.html.j2 +136 -0
  104. uptimely_core-0.2.0.dev0/src/uptimely/templates/plan/overview.html.j2 +3 -0
  105. uptimely_core-0.2.0.dev0/src/uptimely/templates/plan/stages.html.j2 +3 -0
  106. uptimely_core-0.1.0.dev0/src/uptimely/__init__.py +0 -27
  107. uptimely_core-0.1.0.dev0/src/uptimely/analytics/__init__.py +0 -18
  108. uptimely_core-0.1.0.dev0/src/uptimely/analytics/render.py +0 -110
  109. uptimely_core-0.1.0.dev0/src/uptimely/analytics/templates/base.html.j2 +0 -31
  110. uptimely_core-0.1.0.dev0/src/uptimely/analytics/templates/graph.html.j2 +0 -118
  111. uptimely_core-0.1.0.dev0/src/uptimely/compile/__init__.py +0 -16
  112. uptimely_core-0.1.0.dev0/src/uptimely/compile/compiler.py +0 -161
  113. uptimely_core-0.1.0.dev0/src/uptimely/compile/entrypoint.py +0 -89
  114. uptimely_core-0.1.0.dev0/src/uptimely/compile/execution_graph.py +0 -272
  115. uptimely_core-0.1.0.dev0/src/uptimely/compile/node.py +0 -68
  116. uptimely_core-0.1.0.dev0/src/uptimely/compile/render.py +0 -85
  117. uptimely_core-0.1.0.dev0/src/uptimely/compile/templates/report.html.j2 +0 -108
  118. uptimely_core-0.1.0.dev0/src/uptimely/docs/docs.py +0 -248
  119. uptimely_core-0.1.0.dev0/src/uptimely/docs/templates/docs.html.j2 +0 -42
  120. uptimely_core-0.1.0.dev0/src/uptimely/docs/templates/sections/dimensions.html.j2 +0 -4
  121. uptimely_core-0.1.0.dev0/src/uptimely/docs/templates/sections/entities.html.j2 +0 -172
  122. uptimely_core-0.1.0.dev0/src/uptimely/docs/templates/sections/functions.html.j2 +0 -48
  123. uptimely_core-0.1.0.dev0/src/uptimely/docs/templates/sections/overview.html.j2 +0 -18
  124. uptimely_core-0.1.0.dev0/src/uptimely/engine/backend.py +0 -127
  125. uptimely_core-0.1.0.dev0/src/uptimely/engine/engine.py +0 -424
  126. uptimely_core-0.1.0.dev0/src/uptimely/mcp/__init__.py +0 -5
  127. uptimely_core-0.1.0.dev0/src/uptimely/plan/__init__.py +0 -6
  128. uptimely_core-0.1.0.dev0/src/uptimely/plan/models.py +0 -275
  129. uptimely_core-0.1.0.dev0/src/uptimely/plan/serialization.py +0 -16
  130. uptimely_core-0.1.0.dev0/src/uptimely/spec/__init__.py +0 -50
  131. uptimely_core-0.1.0.dev0/src/uptimely/spec/json_spec/__init__.py +0 -1
  132. uptimely_core-0.1.0.dev0/src/uptimely/spec/json_spec/bindings.py +0 -95
  133. uptimely_core-0.1.0.dev0/src/uptimely/spec/json_spec/json_functions.py +0 -353
  134. uptimely_core-0.1.0.dev0/src/uptimely/spec/json_spec/json_model.py +0 -360
  135. uptimely_core-0.1.0.dev0/src/uptimely/spec/json_spec/json_parser.py +0 -378
  136. uptimely_core-0.1.0.dev0/src/uptimely/spec/json_spec/json_serializer.py +0 -32
  137. uptimely_core-0.1.0.dev0/src/uptimely/spec/python_spec/__init__.py +0 -1
  138. uptimely_core-0.1.0.dev0/src/uptimely/spec/python_spec/bind.py +0 -101
  139. uptimely_core-0.1.0.dev0/src/uptimely/spec/python_spec/dataset.py +0 -199
  140. uptimely_core-0.1.0.dev0/src/uptimely/spec/python_spec/entity.py +0 -53
  141. uptimely_core-0.1.0.dev0/src/uptimely/spec/python_spec/feature.py +0 -93
  142. uptimely_core-0.1.0.dev0/src/uptimely/spec/python_spec/fragment.py +0 -106
  143. uptimely_core-0.1.0.dev0/src/uptimely/spec/python_spec/ref.py +0 -63
  144. uptimely_core-0.1.0.dev0/src/uptimely/spec/python_spec/spec.py +0 -76
  145. uptimely_core-0.1.0.dev0/src/uptimely/spec/validation.py +0 -323
  146. {uptimely_core-0.1.0.dev0 → uptimely_core-0.2.0.dev0}/LICENSE +0 -0
  147. {uptimely_core-0.1.0.dev0 → uptimely_core-0.2.0.dev0}/src/uptimely/cli/__init__.py +0 -0
  148. {uptimely_core-0.1.0.dev0/src/uptimely/docs → uptimely_core-0.2.0.dev0/src/uptimely/explorer}/__init__.py +0 -0
  149. {uptimely_core-0.1.0.dev0 → uptimely_core-0.2.0.dev0}/src/uptimely/py.typed +0 -0
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: uptimely-core
3
- Version: 0.1.0.dev0
4
- Summary: Declarative numerical analytics with complex dependencies at scale
3
+ Version: 0.2.0.dev0
4
+ Summary: Manage data-driven numerical analytics with complex dependencies at scale
5
5
  License-Expression: MIT
6
6
  License-File: LICENSE
7
7
  Keywords: analytics,declarative,industrial,feature-engineering,polars
@@ -24,15 +24,18 @@ Requires-Dist: numpy (>=1.26,<3.0)
24
24
  Requires-Dist: polars (>=1.0,<2.0)
25
25
  Requires-Dist: pydantic (>=2.10,<3.0)
26
26
  Project-URL: Documentation, https://uptimely-ai.github.io/uptimely-core
27
- Project-URL: Homepage, https://github.com/uptimely-ai/uptimely-core
27
+ Project-URL: Homepage, http://uptimely.ai/core/
28
28
  Project-URL: Repository, https://github.com/uptimely-ai/uptimely-core
29
29
  Description-Content-Type: text/markdown
30
30
 
31
31
  # Uptimely Core
32
32
 
33
- Uptimely Core is an open source Python package for declarative numerical analytics with complex dependencies at scale.
33
+ Uptimely Core is an open source Python package for declarative numerical
34
+ analytics with complex dependencies at scale.
34
35
 
35
- It describes analytics workflows in a specification similar to OpenAPI, uses a declarative model inspired by Kubernetes. The framework generates plans, graphs, and documentation from that specification.
36
+ Analytics definitions describe workflows in JSON, using a declarative model
37
+ inspired by OpenAPI and Kubernetes. The compiler generates plans from the
38
+ analytics; the package can also render dependency graphs and documentation.
36
39
 
37
40
  Ships with simple engine and plans to integrate to common execution backends.
38
41
 
@@ -53,15 +56,26 @@ Read more at [uptimely.ai website](https://uptimely.ai).
53
56
 
54
57
  ## Quick start
55
58
 
56
- Install the package, download examples and run.
59
+ Python 3.13 or newer is required. Install the package, download the examples
60
+ and run.
61
+
62
+ With pip:
57
63
 
58
64
  ```sh
59
65
  pip install uptimely-core
60
66
  uptimely examples download
61
- python examples/run_all.py
67
+ uptimely explorer serve --project-root examples/pump_analytics
68
+ ```
69
+
70
+ With Poetry, from your Poetry project:
71
+
72
+ ```sh
73
+ poetry add uptimely-core
74
+ poetry run uptimely examples download
75
+ poetry run uptimely explorer serve --project-root examples/pump_analytics
62
76
  ```
63
77
 
64
- Explore the examples files, generated resources and modify for the needs of your own project.
78
+ More use cases in [examples](examples/README.md). Explore the examples files, generated resources and modify for the needs of your own project.
65
79
 
66
80
  ## Documentation
67
81
 
@@ -74,7 +88,7 @@ Explore the [documentation site](https://uptimely-ai.github.io/uptimely-core/).
74
88
  | [`docs/`](docs/index.md) | Architecture, specification, and development documentation. |
75
89
  | [`examples/`](examples/README.md) | Runnable examples and generated artifacts. |
76
90
  | [`scripts/`](scripts) | Code snippets for repository management |
77
- | [`src/uptimely/`](src/uptimely/) | Package implementation for specifications, compilation, dependencies, documentation, and engine. |
91
+ | [`src/uptimely/`](src/uptimely/) | Package implementation for analytics, compilation, dependencies, documentation, and execution. |
78
92
  | [`tests/`](tests/) | Automated tests for the package and examples. |
79
93
 
80
94
  ## Development
@@ -4,8 +4,8 @@ build-backend = "poetry.core.masonry.api"
4
4
 
5
5
  [project]
6
6
  name = "uptimely-core"
7
- version = "0.1.0.dev0"
8
- description = "Declarative numerical analytics with complex dependencies at scale"
7
+ version = "0.2.0.dev0"
8
+ description = "Manage data-driven numerical analytics with complex dependencies at scale"
9
9
  authors = [{ name = "Mikael Ahonen", email = "mikael.ahonen@uptimely.ai" }]
10
10
  license = "MIT"
11
11
  license-files = ["LICENSE"]
@@ -39,12 +39,12 @@ uptimely = "uptimely.cli.cli:main"
39
39
  uptimely-mcp = "uptimely.mcp.server:main"
40
40
 
41
41
  [project.urls]
42
- Homepage = "https://github.com/uptimely-ai/uptimely-core"
42
+ Homepage = "http://uptimely.ai/core/"
43
43
  Repository = "https://github.com/uptimely-ai/uptimely-core"
44
44
  Documentation = "https://uptimely-ai.github.io/uptimely-core"
45
45
 
46
46
  [dependency-groups]
47
- test = ["pytest>=8.0", "pytest-cov>=5.0"]
47
+ test = ["pytest>=8.0", "pytest-cov>=5.0", "pytest-xdist (>=3.6,<4.0)"]
48
48
  dev = ["pre-commit>=3.0", "ruff>=0.8"]
49
49
  docs = ["mkdocs>=1.6,<2.0", "mkdocs-material>=9.7,<10.0", "mkdocstrings[python]>=1.0,<2.0"]
50
50
 
@@ -68,7 +68,7 @@ convention = "google"
68
68
 
69
69
  [tool.pytest.ini_options]
70
70
  testpaths = ["tests"]
71
- addopts = "--strict-markers --strict-config"
71
+ addopts = "--strict-markers --strict-config -n 4"
72
72
  markers = [
73
73
  "integration: end-to-end tests using example projects",
74
74
  ]
@@ -1,8 +1,11 @@
1
1
  # Uptimely Core
2
2
 
3
- Uptimely Core is an open source Python package for declarative numerical analytics with complex dependencies at scale.
3
+ Uptimely Core is an open source Python package for declarative numerical
4
+ analytics with complex dependencies at scale.
4
5
 
5
- It describes analytics workflows in a specification similar to OpenAPI, uses a declarative model inspired by Kubernetes. The framework generates plans, graphs, and documentation from that specification.
6
+ Analytics definitions describe workflows in JSON, using a declarative model
7
+ inspired by OpenAPI and Kubernetes. The compiler generates plans from the
8
+ analytics; the package can also render dependency graphs and documentation.
6
9
 
7
10
  Ships with simple engine and plans to integrate to common execution backends.
8
11
 
@@ -23,15 +26,26 @@ Read more at [uptimely.ai website](https://uptimely.ai).
23
26
 
24
27
  ## Quick start
25
28
 
26
- Install the package, download examples and run.
29
+ Python 3.13 or newer is required. Install the package, download the examples
30
+ and run.
31
+
32
+ With pip:
27
33
 
28
34
  ```sh
29
35
  pip install uptimely-core
30
36
  uptimely examples download
31
- python examples/run_all.py
37
+ uptimely explorer serve --project-root examples/pump_analytics
38
+ ```
39
+
40
+ With Poetry, from your Poetry project:
41
+
42
+ ```sh
43
+ poetry add uptimely-core
44
+ poetry run uptimely examples download
45
+ poetry run uptimely explorer serve --project-root examples/pump_analytics
32
46
  ```
33
47
 
34
- Explore the examples files, generated resources and modify for the needs of your own project.
48
+ More use cases in [examples](examples/README.md). Explore the examples files, generated resources and modify for the needs of your own project.
35
49
 
36
50
  ## Documentation
37
51
 
@@ -44,7 +58,7 @@ Explore the [documentation site](https://uptimely-ai.github.io/uptimely-core/).
44
58
  | [`docs/`](docs/index.md) | Architecture, specification, and development documentation. |
45
59
  | [`examples/`](examples/README.md) | Runnable examples and generated artifacts. |
46
60
  | [`scripts/`](scripts) | Code snippets for repository management |
47
- | [`src/uptimely/`](src/uptimely/) | Package implementation for specifications, compilation, dependencies, documentation, and engine. |
61
+ | [`src/uptimely/`](src/uptimely/) | Package implementation for analytics, compilation, dependencies, documentation, and execution. |
48
62
  | [`tests/`](tests/) | Automated tests for the package and examples. |
49
63
 
50
64
  ## Development
@@ -0,0 +1,40 @@
1
+ """Public package namespace for uptimely."""
2
+
3
+ from .analytics import (
4
+ Analytics,
5
+ Call,
6
+ Dimension,
7
+ Entity,
8
+ FeatureGraph,
9
+ Function,
10
+ PreparedAnalytics,
11
+ PythonAnalytics,
12
+ SubGraph,
13
+ from_python,
14
+ load_analytics,
15
+ prepare_analytics,
16
+ write_document,
17
+ )
18
+ from .compiler import CallableGraph, CallableNode, Compiler, ExecutionPlan
19
+ from .engine import Engine
20
+
21
+ __all__ = [
22
+ "Analytics",
23
+ "Call",
24
+ "CallableGraph",
25
+ "CallableNode",
26
+ "Compiler",
27
+ "Dimension",
28
+ "Entity",
29
+ "ExecutionPlan",
30
+ "Function",
31
+ "PythonAnalytics",
32
+ "PreparedAnalytics",
33
+ "from_python",
34
+ "load_analytics",
35
+ "prepare_analytics",
36
+ "write_document",
37
+ "SubGraph",
38
+ "FeatureGraph",
39
+ "Engine",
40
+ ]
@@ -0,0 +1,65 @@
1
+ """Public package namespace for OpenAnalytics analytics."""
2
+
3
+ from uptimely.row_context import RowContext
4
+
5
+ from .api import from_python, load_analytics, prepare_analytics
6
+ from .feature_graph import FeatureGraph, SubGraph
7
+ from .json.codec import write_document
8
+ from .model import (
9
+ Analytics,
10
+ Argument,
11
+ Binding,
12
+ Dataset,
13
+ Dimension,
14
+ Entity,
15
+ Feature,
16
+ FunctionCatalog,
17
+ Mapping,
18
+ Order,
19
+ RowScope,
20
+ )
21
+ from .python import (
22
+ PythonAnalytics,
23
+ bind,
24
+ dataset,
25
+ dimension,
26
+ entity,
27
+ feature,
28
+ mapping,
29
+ ref,
30
+ row_context,
31
+ )
32
+ from .resolved import Call, Function, PreparedAnalytics
33
+
34
+ __all__ = [
35
+ "Argument",
36
+ "Binding",
37
+ "Call",
38
+ "Dataset",
39
+ "Dimension",
40
+ "Entity",
41
+ "Feature",
42
+ "FeatureGraph",
43
+ "Function",
44
+ "FunctionCatalog",
45
+ "Mapping",
46
+ "Order",
47
+ "PythonAnalytics",
48
+ "RowContext",
49
+ "RowScope",
50
+ "Analytics",
51
+ "PreparedAnalytics",
52
+ "from_python",
53
+ "load_analytics",
54
+ "prepare_analytics",
55
+ "write_document",
56
+ "SubGraph",
57
+ "bind",
58
+ "dataset",
59
+ "dimension",
60
+ "entity",
61
+ "feature",
62
+ "mapping",
63
+ "ref",
64
+ "row_context",
65
+ ]
@@ -0,0 +1,82 @@
1
+ """Build and load validated analytics through explicit application operations."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import pathlib
6
+
7
+ from . import model, resolution, resolved, validation
8
+ from .json import codec
9
+ from .python import conversion
10
+
11
+
12
+ def prepare_analytics(document: model.Analytics) -> resolved.PreparedAnalytics:
13
+ """Resolve and validate a document without adding derived state to it.
14
+
15
+ Preparation uses declarative metadata, not executable Python signatures.
16
+ Rebuild the result after changing the document; it is not an automatic cache.
17
+
18
+ Args:
19
+ document: An analytics document that conforms to the document model.
20
+
21
+ Returns:
22
+ The document paired with its resolved functions and calls.
23
+
24
+ Raises:
25
+ ValueError: Analytics references, mappings, or dependencies are invalid.
26
+ """
27
+ functions, calls = resolution.resolve_functions(document)
28
+ validation.validate_prepared(document, functions, calls)
29
+ return resolved.PreparedAnalytics(document=document, functions=functions, calls=calls)
30
+
31
+
32
+ def load_analytics(path: str | pathlib.Path) -> model.Analytics:
33
+ """Load and semantically validate an analytics JSON file or directory.
34
+
35
+ Args:
36
+ path: A JSON document or a directory containing ``analytics.json``.
37
+
38
+ Returns:
39
+ A validated analytics document without attached derived state.
40
+
41
+ Raises:
42
+ OSError: The JSON document cannot be read.
43
+ ValueError: The document or its analytics declarations are invalid.
44
+ """
45
+ document = model.Analytics.model_validate(codec.load_document(path))
46
+ prepare_analytics(document)
47
+ return document
48
+
49
+
50
+ def from_python(
51
+ datasets: conversion.Datasets | None = None,
52
+ functions: conversion.Functions | None = None,
53
+ name: str | None = None,
54
+ dimensions: conversion.Dimensions | None = None,
55
+ *,
56
+ entities: conversion.Entities | None = None,
57
+ ) -> model.Analytics:
58
+ """Convert Python declarations and semantically validate the resulting model.
59
+
60
+ Args:
61
+ datasets: Dataset declarations wrapped in a single entity.
62
+ functions: Explicit catalog, or infer it from Python declarations.
63
+ name: Optional analytics name and synthetic entity identifier.
64
+ dimensions: Global dimension declarations.
65
+ entities: Explicit entity declarations, mutually exclusive with datasets.
66
+
67
+ Returns:
68
+ A validated analytics document without attached derived state.
69
+
70
+ Raises:
71
+ TypeError: Declarations have unsupported types.
72
+ ValueError: Declarations conflict or analytics semantics are invalid.
73
+ """
74
+ document = conversion.to_model(
75
+ datasets=datasets,
76
+ functions=functions,
77
+ name=name,
78
+ dimensions=dimensions,
79
+ entities=entities,
80
+ )
81
+ prepare_analytics(document)
82
+ return document
@@ -0,0 +1,41 @@
1
+ """Shared function-catalog construction, merging, and serialization."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import collections.abc
6
+
7
+ from uptimely import contracts
8
+
9
+ from . import model as analytics_model
10
+
11
+
12
+ def function_template(
13
+ function_id: str,
14
+ operation: contracts.FunctionOperation,
15
+ entrypoint: str,
16
+ args: dict[str, analytics_model.Argument],
17
+ ) -> analytics_model.FunctionTemplate:
18
+ """Create a function template for the analytics document from its declarations."""
19
+ return analytics_model.FunctionTemplate(
20
+ id=function_id,
21
+ operation=operation,
22
+ returns=contracts.OPERATION_RETURN_KINDS[operation],
23
+ entrypoint=entrypoint,
24
+ args=args,
25
+ )
26
+
27
+
28
+ def merge_function_catalogs(
29
+ catalogs: collections.abc.Iterable[analytics_model.FunctionCatalog],
30
+ ) -> dict[str, analytics_model.FunctionTemplate]:
31
+ """Merge identical definitions and reject conflicting templates."""
32
+ functions: dict[str, analytics_model.FunctionTemplate] = {}
33
+ for catalog in catalogs:
34
+ for function_id, function in catalog.root.items():
35
+ current = functions.get(function_id)
36
+ if current is None:
37
+ functions[function_id] = function
38
+ continue
39
+ if current != function:
40
+ raise ValueError(f"Conflicting function definition for '{function_id}'")
41
+ return functions
@@ -0,0 +1,14 @@
1
+ """Feature dependency graph models and visualization."""
2
+
3
+ from .graph import FeatureGraph, GraphBase, Node, NodeMeta, SubGraph
4
+ from .models import FeatureNode, FunctionNode
5
+
6
+ __all__ = [
7
+ "FeatureGraph",
8
+ "FeatureNode",
9
+ "FunctionNode",
10
+ "GraphBase",
11
+ "Node",
12
+ "NodeMeta",
13
+ "SubGraph",
14
+ ]