prumi 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 (187) hide show
  1. prumi-0.1.0/.gitignore +37 -0
  2. prumi-0.1.0/LICENSE +202 -0
  3. prumi-0.1.0/NOTICE +2 -0
  4. prumi-0.1.0/PKG-INFO +55 -0
  5. prumi-0.1.0/README.md +25 -0
  6. prumi-0.1.0/_runtime/home.css +162 -0
  7. prumi-0.1.0/_runtime/home.js +65 -0
  8. prumi-0.1.0/_runtime/provenance.js +671 -0
  9. prumi-0.1.0/_runtime/runtime.js +417 -0
  10. prumi-0.1.0/_runtime/shell.js +268 -0
  11. prumi-0.1.0/_runtime/theme.css +49 -0
  12. prumi-0.1.0/hatch_build.py +31 -0
  13. prumi-0.1.0/pyproject.toml +57 -0
  14. prumi-0.1.0/src/prumi/__init__.py +3 -0
  15. prumi-0.1.0/src/prumi/adapters.py +285 -0
  16. prumi-0.1.0/src/prumi/agent_output.py +124 -0
  17. prumi-0.1.0/src/prumi/cli.py +228 -0
  18. prumi-0.1.0/src/prumi/config.py +174 -0
  19. prumi-0.1.0/src/prumi/engine.py +454 -0
  20. prumi-0.1.0/src/prumi/issues.py +54 -0
  21. prumi-0.1.0/src/prumi/mcp/__init__.py +786 -0
  22. prumi-0.1.0/src/prumi/mcp/authoring_guide.md +748 -0
  23. prumi-0.1.0/src/prumi/registry/__init__.py +539 -0
  24. prumi-0.1.0/src/prumi/registry/migrations/0001_initial.sql +44 -0
  25. prumi-0.1.0/src/prumi/registry/migrations/0002_page_checks.sql +13 -0
  26. prumi-0.1.0/src/prumi/registry/migrations/0003_page_checks_without_data.sql +19 -0
  27. prumi-0.1.0/src/prumi/scrub.py +27 -0
  28. prumi-0.1.0/src/prumi/server/__init__.py +39 -0
  29. prumi-0.1.0/src/prumi/server/app.py +258 -0
  30. prumi-0.1.0/src/prumi/server/assets.py +23 -0
  31. prumi-0.1.0/src/prumi/server/guards.py +33 -0
  32. prumi-0.1.0/src/prumi/server/pages.py +350 -0
  33. prumi-0.1.0/src/prumi/services.py +164 -0
  34. prumi-0.1.0/src/prumi/source.py +103 -0
  35. prumi-0.1.0/src/prumi/spec/__init__.py +31 -0
  36. prumi-0.1.0/src/prumi/spec/dashboard-spec.v0.schema.json +506 -0
  37. prumi-0.1.0/src/prumi/spec/load.py +48 -0
  38. prumi-0.1.0/src/prumi/spec/models.py +107 -0
  39. prumi-0.1.0/src/prumi/spec/schema.py +46 -0
  40. prumi-0.1.0/src/prumi/time.py +350 -0
  41. prumi-0.1.0/src/prumi/validate/__init__.py +161 -0
  42. prumi-0.1.0/src/prumi/validate/_parse.py +312 -0
  43. prumi-0.1.0/src/prumi/validate/html.py +519 -0
  44. prumi-0.1.0/src/prumi/validate/layout.js +256 -0
  45. prumi-0.1.0/src/prumi/validate/page.py +792 -0
  46. prumi-0.1.0/src/prumi/validate/rules.py +302 -0
  47. prumi-0.1.0/tests/conftest.py +313 -0
  48. prumi-0.1.0/tests/fixtures/browser/failing.html +18 -0
  49. prumi-0.1.0/tests/fixtures/browser/failing.yaml +16 -0
  50. prumi-0.1.0/tests/fixtures/browser/probe.html +59 -0
  51. prumi-0.1.0/tests/fixtures/browser/probe.yaml +25 -0
  52. prumi-0.1.0/tests/fixtures/browser/unverified.html +15 -0
  53. prumi-0.1.0/tests/fixtures/browser/unverified.yaml +13 -0
  54. prumi-0.1.0/tests/fixtures/demo/sales.html +41 -0
  55. prumi-0.1.0/tests/fixtures/demo/sales.yaml +26 -0
  56. prumi-0.1.0/tests/fixtures/fourth_run/weekly-revenue-aov-regions.fixed.html +408 -0
  57. prumi-0.1.0/tests/fixtures/fourth_run/weekly-revenue-aov-regions.html +408 -0
  58. prumi-0.1.0/tests/fixtures/fourth_run/weekly-revenue-aov-regions.spec.json +54 -0
  59. prumi-0.1.0/tests/fixtures/layout/clean.html +19 -0
  60. prumi-0.1.0/tests/fixtures/layout/problems.html +28 -0
  61. prumi-0.1.0/tests/fixtures/layout/spec.json +6 -0
  62. prumi-0.1.0/tests/fixtures/provenance/average_of_averages.html +21 -0
  63. prumi-0.1.0/tests/fixtures/provenance/average_of_averages.json +33 -0
  64. prumi-0.1.0/tests/fixtures/provenance/axis_ticks.html +35 -0
  65. prumi-0.1.0/tests/fixtures/provenance/axis_ticks.json +32 -0
  66. prumi-0.1.0/tests/fixtures/provenance/coincident_average.html +22 -0
  67. prumi-0.1.0/tests/fixtures/provenance/coincident_average.json +38 -0
  68. prumi-0.1.0/tests/fixtures/provenance/compact_outside_axis.html +14 -0
  69. prumi-0.1.0/tests/fixtures/provenance/compact_outside_axis.json +25 -0
  70. prumi-0.1.0/tests/fixtures/provenance/copied_today.html +13 -0
  71. prumi-0.1.0/tests/fixtures/provenance/copied_today.json +25 -0
  72. prumi-0.1.0/tests/fixtures/provenance/dates_and_periods.html +27 -0
  73. prumi-0.1.0/tests/fixtures/provenance/dates_and_periods.json +34 -0
  74. prumi-0.1.0/tests/fixtures/provenance/expected.json +34 -0
  75. prumi-0.1.0/tests/fixtures/provenance/first_run.html +448 -0
  76. prumi-0.1.0/tests/fixtures/provenance/first_run.json +98 -0
  77. prumi-0.1.0/tests/fixtures/provenance/image_numbers.html +14 -0
  78. prumi-0.1.0/tests/fixtures/provenance/image_numbers.json +25 -0
  79. prumi-0.1.0/tests/fixtures/provenance/js_total.html +20 -0
  80. prumi-0.1.0/tests/fixtures/provenance/js_total.json +27 -0
  81. prumi-0.1.0/tests/fixtures/provenance/probe.html +24 -0
  82. prumi-0.1.0/tests/fixtures/provenance/probe.json +6 -0
  83. prumi-0.1.0/tests/fixtures/provenance/spaced_series_outside_svg.html +18 -0
  84. prumi-0.1.0/tests/fixtures/provenance/spaced_series_outside_svg.json +32 -0
  85. prumi-0.1.0/tests/fixtures/provenance/third_run.html +440 -0
  86. prumi-0.1.0/tests/fixtures/provenance/third_run.json +94 -0
  87. prumi-0.1.0/tests/fixtures/provenance/tooltip.html +39 -0
  88. prumi-0.1.0/tests/fixtures/provenance/tooltip.json +26 -0
  89. prumi-0.1.0/tests/fixtures/r8/array_of_12_numbers.html +9 -0
  90. prumi-0.1.0/tests/fixtures/r8/array_of_objects.html +19 -0
  91. prumi-0.1.0/tests/fixtures/r8/chart_config.html +24 -0
  92. prumi-0.1.0/tests/fixtures/r8/expected.json +10 -0
  93. prumi-0.1.0/tests/fixtures/r8/json_chart_data.html +16 -0
  94. prumi-0.1.0/tests/fixtures/r8/no_inline_script.html +10 -0
  95. prumi-0.1.0/tests/fixtures/r8/numbers_in_table.html +13 -0
  96. prumi-0.1.0/tests/fixtures/r8/numbers_in_text.html +7 -0
  97. prumi-0.1.0/tests/fixtures/r8/plain_numbers_in_text.html +6 -0
  98. prumi-0.1.0/tests/fixtures/registry/golden.html +3 -0
  99. prumi-0.1.0/tests/fixtures/registry/golden.yaml +9 -0
  100. prumi-0.1.0/tests/fixtures/specs/spec-example.yaml +56 -0
  101. prumi-0.1.0/tests/fixtures/validator/R10.mixed_units.yaml +28 -0
  102. prumi-0.1.0/tests/fixtures/validator/R10.no_format.yaml +28 -0
  103. prumi-0.1.0/tests/fixtures/validator/R2.filter_dimension_invalid.yaml +30 -0
  104. prumi-0.1.0/tests/fixtures/validator/R2.invalid_dimension.yaml +31 -0
  105. prumi-0.1.0/tests/fixtures/validator/R3.empty_window.yaml +33 -0
  106. prumi-0.1.0/tests/fixtures/validator/R3.no_window.yaml +27 -0
  107. prumi-0.1.0/tests/fixtures/validator/R3.partial_in_comparison.yaml +28 -0
  108. prumi-0.1.0/tests/fixtures/validator/R3.stale_data.yaml +32 -0
  109. prumi-0.1.0/tests/fixtures/validator/R3.window_snapped.yaml +32 -0
  110. prumi-0.1.0/tests/fixtures/validator/R3.window_too_short.yaml +31 -0
  111. prumi-0.1.0/tests/fixtures/validator/R4.compare_with_time_grain.yaml +28 -0
  112. prumi-0.1.0/tests/fixtures/validator/R4.grain_mismatch.yaml +27 -0
  113. prumi-0.1.0/tests/fixtures/validator/R5.multiple_windows.yaml +28 -0
  114. prumi-0.1.0/tests/fixtures/validator/R6.others_requires_top_n.yaml +26 -0
  115. prumi-0.1.0/tests/fixtures/validator/R6.top_n_shape.yaml +26 -0
  116. prumi-0.1.0/tests/fixtures/validator/R6.total_requires_grouping.yaml +28 -0
  117. prumi-0.1.0/tests/fixtures/validator/R7.unknown_metric.yaml +27 -0
  118. prumi-0.1.0/tests/fixtures/validator/R7.unknown_metric_request.yaml +28 -0
  119. prumi-0.1.0/tests/fixtures/validator/R8.embedded_numbers.html +43 -0
  120. prumi-0.1.0/tests/fixtures/validator/R8.embedded_numbers.yaml +27 -0
  121. prumi-0.1.0/tests/fixtures/validator/R8.numbers_in_table.html +48 -0
  122. prumi-0.1.0/tests/fixtures/validator/R8.numbers_in_table.yaml +28 -0
  123. prumi-0.1.0/tests/fixtures/validator/R8.numbers_in_text.html +42 -0
  124. prumi-0.1.0/tests/fixtures/validator/R8.numbers_in_text.yaml +28 -0
  125. prumi-0.1.0/tests/fixtures/validator/_base.html +41 -0
  126. prumi-0.1.0/tests/fixtures/validator/_base.yaml +25 -0
  127. prumi-0.1.0/tests/fixtures/validator/filter.invalid_value.yaml +27 -0
  128. prumi-0.1.0/tests/fixtures/validator/html.binding_selector.html +41 -0
  129. prumi-0.1.0/tests/fixtures/validator/html.binding_selector.yaml +29 -0
  130. prumi-0.1.0/tests/fixtures/validator/html.closed_shadow_root.html +42 -0
  131. prumi-0.1.0/tests/fixtures/validator/html.closed_shadow_root.yaml +27 -0
  132. prumi-0.1.0/tests/fixtures/validator/html.iframe.html +42 -0
  133. prumi-0.1.0/tests/fixtures/validator/html.iframe.yaml +27 -0
  134. prumi-0.1.0/tests/fixtures/validator/html.image.html +42 -0
  135. prumi-0.1.0/tests/fixtures/validator/html.image.yaml +27 -0
  136. prumi-0.1.0/tests/fixtures/validator/html.network_call.html +42 -0
  137. prumi-0.1.0/tests/fixtures/validator/html.network_call.yaml +28 -0
  138. prumi-0.1.0/tests/fixtures/validator/html.script_host.html +41 -0
  139. prumi-0.1.0/tests/fixtures/validator/html.script_host.yaml +27 -0
  140. prumi-0.1.0/tests/fixtures/validator/html.unbound_block.html +41 -0
  141. prumi-0.1.0/tests/fixtures/validator/html.unbound_block.yaml +28 -0
  142. prumi-0.1.0/tests/fixtures/validator/html.unknown_block.html +42 -0
  143. prumi-0.1.0/tests/fixtures/validator/html.unknown_block.yaml +27 -0
  144. prumi-0.1.0/tests/fixtures/validator/html.unpinned_script.html +41 -0
  145. prumi-0.1.0/tests/fixtures/validator/html.unpinned_script.yaml +28 -0
  146. prumi-0.1.0/tests/fixtures/validator/query.failed.yaml +27 -0
  147. prumi-0.1.0/tests/fixtures/validator/result.truncated.yaml +32 -0
  148. prumi-0.1.0/tests/fixtures/validator/spec.duplicate_id.yaml +27 -0
  149. prumi-0.1.0/tests/fixtures/validator/spec.invalid.missing_field.yaml +28 -0
  150. prumi-0.1.0/tests/fixtures/validator/spec.invalid.out_of_range.yaml +28 -0
  151. prumi-0.1.0/tests/fixtures/validator/spec.invalid.unknown_field.yaml +28 -0
  152. prumi-0.1.0/tests/fixtures/validator/spec.invalid.wrong_container.yaml +28 -0
  153. prumi-0.1.0/tests/fixtures/validator/spec.invalid.wrong_type.yaml +28 -0
  154. prumi-0.1.0/tests/fixtures/validator/spec.invalid.wrong_value.yaml +28 -0
  155. prumi-0.1.0/tests/fixtures/validator/spec.invalid_interaction.yaml +27 -0
  156. prumi-0.1.0/tests/fixtures/validator/spec.unknown_block.yaml +27 -0
  157. prumi-0.1.0/tests/fixtures/validator/spec.unknown_filter.yaml +27 -0
  158. prumi-0.1.0/tests/fixtures/validator/spec.unsupported_calendar.yaml +27 -0
  159. prumi-0.1.0/tests/test_adapters.py +157 -0
  160. prumi-0.1.0/tests/test_agent_output.py +103 -0
  161. prumi-0.1.0/tests/test_assets.py +47 -0
  162. prumi-0.1.0/tests/test_authoring_guide.py +105 -0
  163. prumi-0.1.0/tests/test_browser.py +806 -0
  164. prumi-0.1.0/tests/test_cli.py +255 -0
  165. prumi-0.1.0/tests/test_config.py +111 -0
  166. prumi-0.1.0/tests/test_docs.py +120 -0
  167. prumi-0.1.0/tests/test_end_to_end.py +218 -0
  168. prumi-0.1.0/tests/test_engine_demo.py +413 -0
  169. prumi-0.1.0/tests/test_home.py +240 -0
  170. prumi-0.1.0/tests/test_hosting.py +133 -0
  171. prumi-0.1.0/tests/test_html.py +194 -0
  172. prumi-0.1.0/tests/test_import.py +5 -0
  173. prumi-0.1.0/tests/test_import_boundary.py +45 -0
  174. prumi-0.1.0/tests/test_layout.py +86 -0
  175. prumi-0.1.0/tests/test_logging.py +126 -0
  176. prumi-0.1.0/tests/test_mcp.py +831 -0
  177. prumi-0.1.0/tests/test_no_company_data.py +246 -0
  178. prumi-0.1.0/tests/test_provenance.py +752 -0
  179. prumi-0.1.0/tests/test_registry.py +389 -0
  180. prumi-0.1.0/tests/test_release.py +357 -0
  181. prumi-0.1.0/tests/test_server.py +232 -0
  182. prumi-0.1.0/tests/test_shutdown.py +112 -0
  183. prumi-0.1.0/tests/test_spec.py +133 -0
  184. prumi-0.1.0/tests/test_theme.py +57 -0
  185. prumi-0.1.0/tests/test_time.py +387 -0
  186. prumi-0.1.0/tests/test_validate.py +201 -0
  187. prumi-0.1.0/tests/test_validate_demo.py +114 -0
prumi-0.1.0/.gitignore ADDED
@@ -0,0 +1,37 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ .venv/
5
+ build/
6
+ dist/
7
+ *.egg-info/
8
+ .pytest_cache/
9
+ .ruff_cache/
10
+ .coverage
11
+ htmlcov/
12
+
13
+ # Node
14
+ node_modules/
15
+
16
+ # dbt
17
+ target/
18
+ dbt_packages/
19
+ logs/
20
+
21
+ # Local data
22
+ *.duckdb
23
+ *.duckdb.wal
24
+
25
+ # Environment and secrets
26
+ .env
27
+ .env.*
28
+ !.env.example
29
+
30
+ # Editors and OS
31
+ .vscode/
32
+ .idea/
33
+ .DS_Store
34
+
35
+ # Prumi data dirs and the demo build's temporary folders
36
+ .prumi/
37
+ .build-*/
prumi-0.1.0/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
prumi-0.1.0/NOTICE ADDED
@@ -0,0 +1,2 @@
1
+ Prumi
2
+ Copyright 2026 The Prumi Authors
prumi-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,55 @@
1
+ Metadata-Version: 2.5
2
+ Name: prumi
3
+ Version: 0.1.0
4
+ Summary: Prumi server: MCP endpoint, catalog, query engine, validator and registry
5
+ Project-URL: Repository, https://github.com/prumihq/prumi
6
+ Project-URL: Issues, https://github.com/prumihq/prumi/issues
7
+ Project-URL: Changelog, https://github.com/prumihq/prumi/blob/main/CHANGELOG.md
8
+ Author: Denner Rodrigues Campelo
9
+ License-Expression: Apache-2.0
10
+ License-File: LICENSE
11
+ License-File: NOTICE
12
+ Keywords: ai-agents,bi,dashboards,dbt,mcp,metrics,semantic-layer
13
+ Classifier: Development Status :: 3 - Alpha
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3 :: Only
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Topic :: Database
18
+ Classifier: Topic :: Scientific/Engineering :: Information Analysis
19
+ Classifier: Topic :: Scientific/Engineering :: Visualization
20
+ Requires-Python: >=3.12
21
+ Requires-Dist: mcp<3,>=2.3
22
+ Requires-Dist: playwright<2,>=1.64
23
+ Requires-Dist: pydantic<3,>=2.14
24
+ Requires-Dist: pyyaml<7,>=6
25
+ Requires-Dist: starlette<2,>=1.8
26
+ Requires-Dist: uvicorn>=0.54
27
+ Provides-Extra: dbt
28
+ Requires-Dist: prumi-adapter-dbt[duckdb]<0.2,>=0.1.0; extra == 'dbt'
29
+ Description-Content-Type: text/markdown
30
+
31
+ # prumi
32
+
33
+ The Prumi server and the `prumi` CLI. AI agents connect to its MCP endpoint and build dashboards on a company's official metrics; Prumi checks every page, hosts it, and lets the data team certify it.
34
+
35
+ Import name: `prumi`. It holds the catalog, the query engine, the BI validator and the registry, and defines the adapter protocol that source adapters implement. Prumi reads metrics through an adapter package; the first one is [`prumi-adapter-dbt`](https://github.com/prumihq/prumi/tree/main/packages/prumi-adapter-dbt).
36
+
37
+ - **Agents** connect over MCP (Streamable HTTP, `/mcp`), find the official metrics, learn the shape of the data (never its values) and publish a dashboard: a spec plus any HTML.
38
+ - **Numbers** come only from the source, computed at the grain they're shown. Validation renders each page in headless Chromium and checks that every number it shows is a value Prumi delivered.
39
+ - **Dashboards** run in a sandboxed frame inside Prumi's own page, which shows the trust badge and data freshness. The data team certifies a version from the CLI; any later change makes it a draft again.
40
+
41
+ ## Install
42
+
43
+ With [uv](https://docs.astral.sh/uv/), Prumi and its dbt adapter:
44
+
45
+ ```sh
46
+ uv tool install "prumi[dbt]"
47
+ prumi install-chromium
48
+ prumi serve --config prumi.toml
49
+ ```
50
+
51
+ `pip install "prumi[dbt]"` installs the same packages. `prumi.toml` points at your dbt project's semantic manifest and warehouse: see [Use it with your metrics](https://github.com/prumihq/prumi#use-it-with-your-metrics) and [every setting](https://github.com/prumihq/prumi/blob/main/docs/configuration.md).
52
+
53
+ Requirements: Python 3.12 or later, and headless Chromium, which `prumi install-chromium` installs with Playwright (add `--with-deps` on Linux if system libraries are missing); the server won't start without it.
54
+
55
+ The quick start on a demo project, configuration and where data goes are in [the Prumi README](https://github.com/prumihq/prumi#readme); the BI rules Prumi checks are in [`docs/bi-rules.md`](https://github.com/prumihq/prumi/blob/main/docs/bi-rules.md).
prumi-0.1.0/README.md ADDED
@@ -0,0 +1,25 @@
1
+ # prumi
2
+
3
+ The Prumi server and the `prumi` CLI. AI agents connect to its MCP endpoint and build dashboards on a company's official metrics; Prumi checks every page, hosts it, and lets the data team certify it.
4
+
5
+ Import name: `prumi`. It holds the catalog, the query engine, the BI validator and the registry, and defines the adapter protocol that source adapters implement. Prumi reads metrics through an adapter package; the first one is [`prumi-adapter-dbt`](https://github.com/prumihq/prumi/tree/main/packages/prumi-adapter-dbt).
6
+
7
+ - **Agents** connect over MCP (Streamable HTTP, `/mcp`), find the official metrics, learn the shape of the data (never its values) and publish a dashboard: a spec plus any HTML.
8
+ - **Numbers** come only from the source, computed at the grain they're shown. Validation renders each page in headless Chromium and checks that every number it shows is a value Prumi delivered.
9
+ - **Dashboards** run in a sandboxed frame inside Prumi's own page, which shows the trust badge and data freshness. The data team certifies a version from the CLI; any later change makes it a draft again.
10
+
11
+ ## Install
12
+
13
+ With [uv](https://docs.astral.sh/uv/), Prumi and its dbt adapter:
14
+
15
+ ```sh
16
+ uv tool install "prumi[dbt]"
17
+ prumi install-chromium
18
+ prumi serve --config prumi.toml
19
+ ```
20
+
21
+ `pip install "prumi[dbt]"` installs the same packages. `prumi.toml` points at your dbt project's semantic manifest and warehouse: see [Use it with your metrics](https://github.com/prumihq/prumi#use-it-with-your-metrics) and [every setting](https://github.com/prumihq/prumi/blob/main/docs/configuration.md).
22
+
23
+ Requirements: Python 3.12 or later, and headless Chromium, which `prumi install-chromium` installs with Playwright (add `--with-deps` on Linux if system libraries are missing); the server won't start without it.
24
+
25
+ The quick start on a demo project, configuration and where data goes are in [the Prumi README](https://github.com/prumihq/prumi#readme); the BI rules Prumi checks are in [`docs/bi-rules.md`](https://github.com/prumihq/prumi/blob/main/docs/bi-rules.md).
@@ -0,0 +1,162 @@
1
+ /* Prumi's home page. Colors, fonts and radius come from theme.css, so the page follows the
2
+ * OS's light or dark mode like the shell does.
3
+ */
4
+ *, *::before, *::after { box-sizing: border-box; }
5
+ [hidden] { display: none !important; }
6
+
7
+ html { background: var(--prumi-bg); }
8
+ body {
9
+ margin: 0;
10
+ min-height: 100vh;
11
+ display: flex;
12
+ flex-direction: column;
13
+ font-family: var(--prumi-font);
14
+ font-size: 15px;
15
+ line-height: 1.45;
16
+ background: var(--prumi-bg);
17
+ color: var(--prumi-text);
18
+ }
19
+ a { color: var(--prumi-accent); }
20
+ code { font-family: var(--prumi-font-mono); font-size: 0.9em; }
21
+ time { white-space: nowrap; }
22
+
23
+ .top, main, .bottom { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
24
+
25
+ .top {
26
+ display: flex;
27
+ flex-wrap: wrap;
28
+ align-items: baseline;
29
+ gap: 4px 16px;
30
+ padding-top: 20px;
31
+ padding-bottom: 16px;
32
+ border-bottom: 1px solid var(--prumi-border);
33
+ }
34
+ .wordmark { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
35
+ .source { margin: 0; color: var(--prumi-text-muted); font-size: 14px; }
36
+ .source span { white-space: nowrap; }
37
+
38
+ main { flex: 1; padding-top: 24px; padding-bottom: 32px; }
39
+ h1, h2 { margin: 0 0 12px; font-weight: 600; }
40
+ h1 { font-size: 18px; }
41
+ h2 { font-size: 16px; }
42
+
43
+ .section-head {
44
+ display: flex;
45
+ flex-wrap: wrap;
46
+ align-items: center;
47
+ justify-content: space-between;
48
+ gap: 8px 16px;
49
+ margin-bottom: 12px;
50
+ }
51
+ .section-head h1 { margin: 0; }
52
+ #search {
53
+ flex: 0 1 280px;
54
+ min-width: 0;
55
+ padding: 6px 10px;
56
+ font: inherit;
57
+ color: var(--prumi-text);
58
+ background: var(--prumi-surface);
59
+ border: 1px solid var(--prumi-border);
60
+ border-radius: var(--prumi-radius);
61
+ }
62
+ #search::placeholder { color: var(--prumi-text-muted); }
63
+ .no-match { color: var(--prumi-text-muted); }
64
+
65
+ .cards {
66
+ list-style: none;
67
+ margin: 0;
68
+ padding: 0;
69
+ display: grid;
70
+ grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
71
+ gap: 12px;
72
+ }
73
+ .card {
74
+ min-width: 0;
75
+ padding: 14px 16px;
76
+ background: var(--prumi-surface);
77
+ border: 1px solid var(--prumi-border);
78
+ border-radius: var(--prumi-radius);
79
+ }
80
+ .card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
81
+ .card-title {
82
+ min-width: 0;
83
+ font-weight: 600;
84
+ font-size: 16px;
85
+ text-decoration: none;
86
+ overflow-wrap: anywhere;
87
+ }
88
+ .card-title:hover, .card-title:focus-visible { text-decoration: underline; }
89
+ .badge {
90
+ flex: none;
91
+ padding: 1px 8px;
92
+ border: 1px solid currentColor;
93
+ border-radius: 12px;
94
+ font-size: 12px;
95
+ white-space: nowrap;
96
+ }
97
+ .badge[data-kind="draft"] { color: var(--prumi-text-muted); }
98
+ .badge[data-kind="certified"] { color: var(--prumi-positive); }
99
+ .badge[data-kind="attention"] { color: var(--prumi-negative); font-weight: 600; }
100
+ .card-meta { margin: 6px 0 0; color: var(--prumi-text-muted); font-size: 13px; }
101
+ .card-meta code { overflow-wrap: anywhere; }
102
+ .labels { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
103
+ .labels li {
104
+ padding: 1px 8px;
105
+ border-radius: 4px;
106
+ background: var(--prumi-bg);
107
+ border: 1px solid var(--prumi-border);
108
+ font-size: 12px;
109
+ }
110
+ .labels .more { color: var(--prumi-text-muted); }
111
+
112
+ .empty {
113
+ max-width: 640px;
114
+ padding: 20px;
115
+ background: var(--prumi-surface);
116
+ border: 1px solid var(--prumi-border);
117
+ border-radius: var(--prumi-radius);
118
+ }
119
+ .empty p { margin: 0 0 8px; }
120
+ .command {
121
+ display: flex;
122
+ align-items: flex-start;
123
+ gap: 8px;
124
+ margin-top: 8px;
125
+ padding: 8px 10px;
126
+ background: var(--prumi-bg);
127
+ border: 1px solid var(--prumi-border);
128
+ border-radius: var(--prumi-radius);
129
+ }
130
+ .command code { flex: 1; min-width: 0; overflow-wrap: anywhere; }
131
+ .copy {
132
+ flex: none;
133
+ padding: 2px 10px;
134
+ font: inherit;
135
+ font-size: 13px;
136
+ color: var(--prumi-accent);
137
+ background: var(--prumi-surface);
138
+ border: 1px solid var(--prumi-border);
139
+ border-radius: var(--prumi-radius);
140
+ cursor: pointer;
141
+ }
142
+
143
+ .requests { margin-top: 32px; }
144
+ .requests ul { margin: 0; padding: 0; list-style: none; }
145
+ .requests li {
146
+ display: flex;
147
+ justify-content: space-between;
148
+ gap: 16px;
149
+ padding: 6px 0;
150
+ border-bottom: 1px solid var(--prumi-border);
151
+ }
152
+ .requests li span { min-width: 0; overflow-wrap: anywhere; }
153
+ .requests time, .requests p { color: var(--prumi-text-muted); font-size: 13px; }
154
+ .requests p { margin: 8px 0 0; }
155
+
156
+ .bottom {
157
+ padding-top: 12px;
158
+ padding-bottom: 20px;
159
+ border-top: 1px solid var(--prumi-border);
160
+ color: var(--prumi-text-muted);
161
+ font-size: 13px;
162
+ }
@@ -0,0 +1,65 @@
1
+ // Prumi's home page: the search box and the copy button. Everything it needs is already on
2
+ // the page; it never calls the server.
3
+ (function () {
4
+ "use strict";
5
+
6
+ function searchText(card) {
7
+ // The card's own text, plus the labels folded into "+N" (they're in its title).
8
+ var more = card.querySelector(".labels .more");
9
+ return (card.textContent + " " + (more ? more.title : "")).toLowerCase();
10
+ }
11
+
12
+ function setUpSearch() {
13
+ var input = document.getElementById("search");
14
+ if (!input) return;
15
+ var cards = Array.prototype.slice.call(document.querySelectorAll("#cards .card"));
16
+ var texts = cards.map(searchText);
17
+ var none = document.getElementById("no-match");
18
+ input.addEventListener("input", function () {
19
+ var words = input.value.toLowerCase().split(/\s+/).filter(Boolean);
20
+ var shown = 0;
21
+ cards.forEach(function (card, i) {
22
+ var match = words.every(function (word) { return texts[i].indexOf(word) !== -1; });
23
+ card.hidden = !match;
24
+ if (match) shown += 1;
25
+ });
26
+ none.hidden = shown > 0;
27
+ });
28
+ }
29
+
30
+ function selectText(element) {
31
+ var range = document.createRange();
32
+ range.selectNodeContents(element);
33
+ var selection = window.getSelection();
34
+ selection.removeAllRanges();
35
+ selection.addRange(range);
36
+ }
37
+
38
+ function setUpCopy() {
39
+ document.querySelectorAll("button[data-copy]").forEach(function (button) {
40
+ var source = document.getElementById(button.getAttribute("data-copy"));
41
+ var label = button.textContent;
42
+ var timer = null;
43
+ function show(text) {
44
+ button.textContent = text;
45
+ clearTimeout(timer);
46
+ timer = setTimeout(function () { button.textContent = label; }, 2000);
47
+ }
48
+ button.addEventListener("click", function () {
49
+ var text = source.textContent;
50
+ if (!navigator.clipboard) {
51
+ selectText(source);
52
+ show("Selected");
53
+ return;
54
+ }
55
+ navigator.clipboard.writeText(text).then(
56
+ function () { show("Copied"); },
57
+ function () { selectText(source); show("Selected"); }
58
+ );
59
+ });
60
+ });
61
+ }
62
+
63
+ setUpSearch();
64
+ setUpCopy();
65
+ })();