datasight 0.7.0__tar.gz → 0.8.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 (310) hide show
  1. {datasight-0.7.0 → datasight-0.8.0}/PKG-INFO +1 -1
  2. {datasight-0.7.0 → datasight-0.8.0}/docs/design/architecture.md +3 -2
  3. {datasight-0.7.0 → datasight-0.8.0}/docs/reference/cli.md +189 -1
  4. {datasight-0.7.0 → datasight-0.8.0}/docs/use/how-to/ask-from-cli.md +3 -0
  5. {datasight-0.7.0 → datasight-0.8.0}/docs/use/how-to/audit-data-quality.md +126 -1
  6. {datasight-0.7.0 → datasight-0.8.0}/docs/use/how-to/save-and-rerun.md +7 -0
  7. datasight-0.8.0/docs/use/tutorials/tidy.md +165 -0
  8. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/App.svelte +227 -102
  9. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/lib/components/CommandPalette.svelte +92 -2
  10. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/lib/components/ConversationsList.svelte +3 -20
  11. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/lib/components/DashboardCard.svelte +1 -0
  12. datasight-0.8.0/frontend/src/lib/components/ExportBar.svelte +167 -0
  13. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/lib/components/MessageList.svelte +6 -66
  14. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/lib/components/ShortcutsModal.svelte +8 -0
  15. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/lib/utils/conversation.ts +34 -6
  16. datasight-0.8.0/frontend/src/lib/utils/pin.ts +102 -0
  17. datasight-0.8.0/frontend/src/lib/utils/shortcuts.ts +154 -0
  18. datasight-0.8.0/frontend/tests/shortcuts.test.ts +156 -0
  19. {datasight-0.7.0 → datasight-0.8.0}/mkdocs.yml +1 -0
  20. {datasight-0.7.0 → datasight-0.8.0}/pyproject.toml +1 -1
  21. {datasight-0.7.0 → datasight-0.8.0}/src/datasight/cli.py +123 -176
  22. {datasight-0.7.0 → datasight-0.8.0}/src/datasight/cli_commands/ask.py +26 -68
  23. {datasight-0.7.0 → datasight-0.8.0}/src/datasight/cli_commands/audit_report.py +23 -56
  24. {datasight-0.7.0 → datasight-0.8.0}/src/datasight/cli_commands/config.py +12 -51
  25. {datasight-0.7.0 → datasight-0.8.0}/src/datasight/cli_commands/demo.py +11 -55
  26. {datasight-0.7.0 → datasight-0.8.0}/src/datasight/cli_commands/dimensions.py +25 -61
  27. {datasight-0.7.0 → datasight-0.8.0}/src/datasight/cli_commands/distribution.py +27 -65
  28. {datasight-0.7.0 → datasight-0.8.0}/src/datasight/cli_commands/doctor.py +16 -55
  29. {datasight-0.7.0 → datasight-0.8.0}/src/datasight/cli_commands/export.py +66 -54
  30. {datasight-0.7.0 → datasight-0.8.0}/src/datasight/cli_commands/generate.py +131 -70
  31. {datasight-0.7.0 → datasight-0.8.0}/src/datasight/cli_commands/init.py +7 -51
  32. {datasight-0.7.0 → datasight-0.8.0}/src/datasight/cli_commands/inspect.py +43 -78
  33. {datasight-0.7.0 → datasight-0.8.0}/src/datasight/cli_commands/integrity.py +23 -61
  34. {datasight-0.7.0 → datasight-0.8.0}/src/datasight/cli_commands/log.py +5 -50
  35. {datasight-0.7.0 → datasight-0.8.0}/src/datasight/cli_commands/measures.py +25 -60
  36. {datasight-0.7.0 → datasight-0.8.0}/src/datasight/cli_commands/profile.py +58 -91
  37. {datasight-0.7.0 → datasight-0.8.0}/src/datasight/cli_commands/quality.py +71 -64
  38. {datasight-0.7.0 → datasight-0.8.0}/src/datasight/cli_commands/recipes.py +21 -64
  39. {datasight-0.7.0 → datasight-0.8.0}/src/datasight/cli_commands/report.py +14 -57
  40. {datasight-0.7.0 → datasight-0.8.0}/src/datasight/cli_commands/run.py +9 -53
  41. datasight-0.8.0/src/datasight/cli_commands/session.py +193 -0
  42. {datasight-0.7.0 → datasight-0.8.0}/src/datasight/cli_commands/templates.py +12 -57
  43. datasight-0.8.0/src/datasight/cli_commands/tidy.py +345 -0
  44. {datasight-0.7.0 → datasight-0.8.0}/src/datasight/cli_commands/trends.py +30 -63
  45. {datasight-0.7.0 → datasight-0.8.0}/src/datasight/cli_commands/validate.py +22 -58
  46. {datasight-0.7.0 → datasight-0.8.0}/src/datasight/cli_commands/verify.py +14 -55
  47. datasight-0.8.0/src/datasight/cli_helpers.py +69 -0
  48. {datasight-0.7.0 → datasight-0.8.0}/src/datasight/explore.py +150 -43
  49. {datasight-0.7.0 → datasight-0.8.0}/src/datasight/export.py +342 -0
  50. datasight-0.8.0/src/datasight/session_archive.py +279 -0
  51. datasight-0.8.0/src/datasight/tidy.py +475 -0
  52. {datasight-0.7.0 → datasight-0.8.0}/src/datasight/web/app.py +39 -7
  53. datasight-0.7.0/src/datasight/web/static/assets/index-B5SIawAX.js → datasight-0.8.0/src/datasight/web/static/assets/index-DLqtixNV.js +118 -115
  54. datasight-0.7.0/src/datasight/web/static/assets/plotly.min-DkfFcv5I.js → datasight-0.8.0/src/datasight/web/static/assets/plotly.min-B2vALIYY.js +1 -1
  55. {datasight-0.7.0 → datasight-0.8.0}/src/datasight/web/templates/index.html +1 -1
  56. {datasight-0.7.0 → datasight-0.8.0}/tests/test_cli_commands.py +2 -2
  57. {datasight-0.7.0 → datasight-0.8.0}/tests/test_cli_config.py +1 -1
  58. {datasight-0.7.0 → datasight-0.8.0}/tests/test_cli_tools.py +52 -52
  59. {datasight-0.7.0 → datasight-0.8.0}/tests/test_cli_tools_extra.py +44 -44
  60. {datasight-0.7.0 → datasight-0.8.0}/tests/test_explore_extra.py +147 -1
  61. {datasight-0.7.0 → datasight-0.8.0}/tests/test_export.py +158 -0
  62. {datasight-0.7.0 → datasight-0.8.0}/tests/test_generate_persist_db.py +271 -2
  63. {datasight-0.7.0 → datasight-0.8.0}/tests/test_reports.py +1 -1
  64. datasight-0.8.0/tests/test_session_archive.py +381 -0
  65. datasight-0.8.0/tests/test_tidy.py +655 -0
  66. {datasight-0.7.0 → datasight-0.8.0}/tests/test_web_app_extra.py +34 -0
  67. {datasight-0.7.0 → datasight-0.8.0}/uv.lock +1 -1
  68. datasight-0.7.0/frontend/src/lib/components/ExportBar.svelte +0 -98
  69. {datasight-0.7.0 → datasight-0.8.0}/.github/dependabot.yml +0 -0
  70. {datasight-0.7.0 → datasight-0.8.0}/.github/workflows/ci.yml +0 -0
  71. {datasight-0.7.0 → datasight-0.8.0}/.github/workflows/codeql.yml +0 -0
  72. {datasight-0.7.0 → datasight-0.8.0}/.github/workflows/gh-pages.yml +0 -0
  73. {datasight-0.7.0 → datasight-0.8.0}/.github/workflows/release.yml +0 -0
  74. {datasight-0.7.0 → datasight-0.8.0}/.gitignore +0 -0
  75. {datasight-0.7.0 → datasight-0.8.0}/.pre-commit-config.yaml +0 -0
  76. {datasight-0.7.0 → datasight-0.8.0}/AGENTS.md +0 -0
  77. {datasight-0.7.0 → datasight-0.8.0}/CLAUDE.md +0 -0
  78. {datasight-0.7.0 → datasight-0.8.0}/DISCLAIMER.md +0 -0
  79. {datasight-0.7.0 → datasight-0.8.0}/LICENSE +0 -0
  80. {datasight-0.7.0 → datasight-0.8.0}/README.md +0 -0
  81. {datasight-0.7.0 → datasight-0.8.0}/codecov.yml +0 -0
  82. {datasight-0.7.0 → datasight-0.8.0}/dashboard-filter-roadmap.md +0 -0
  83. {datasight-0.7.0 → datasight-0.8.0}/docs/assets/datasight-icon.svg +0 -0
  84. {datasight-0.7.0 → datasight-0.8.0}/docs/assets/screenshots/01-landing.png +0 -0
  85. {datasight-0.7.0 → datasight-0.8.0}/docs/assets/screenshots/02-chat-view.png +0 -0
  86. {datasight-0.7.0 → datasight-0.8.0}/docs/assets/screenshots/03-sql-editor.png +0 -0
  87. {datasight-0.7.0 → datasight-0.8.0}/docs/assets/screenshots/04-chart-result.png +0 -0
  88. {datasight-0.7.0 → datasight-0.8.0}/docs/assets/screenshots/05-dashboard.png +0 -0
  89. {datasight-0.7.0 → datasight-0.8.0}/docs/assets/screenshots/06-web-ui-reference.png +0 -0
  90. {datasight-0.7.0 → datasight-0.8.0}/docs/design/contributing.md +0 -0
  91. {datasight-0.7.0 → datasight-0.8.0}/docs/design/how-the-agent-works.md +0 -0
  92. {datasight-0.7.0 → datasight-0.8.0}/docs/design/sql-result-cache.md +0 -0
  93. {datasight-0.7.0 → datasight-0.8.0}/docs/index.md +0 -0
  94. {datasight-0.7.0 → datasight-0.8.0}/docs/project-setup/concepts/semantic-measures.md +0 -0
  95. {datasight-0.7.0 → datasight-0.8.0}/docs/project-setup/how-to/configure-measures.md +0 -0
  96. {datasight-0.7.0 → datasight-0.8.0}/docs/project-setup/how-to/database-connections.md +0 -0
  97. {datasight-0.7.0 → datasight-0.8.0}/docs/project-setup/how-to/declare-joins.md +0 -0
  98. {datasight-0.7.0 → datasight-0.8.0}/docs/project-setup/how-to/declare-time-series.md +0 -0
  99. {datasight-0.7.0 → datasight-0.8.0}/docs/project-setup/how-to/example-queries.md +0 -0
  100. {datasight-0.7.0 → datasight-0.8.0}/docs/project-setup/how-to/querying-files.md +0 -0
  101. {datasight-0.7.0 → datasight-0.8.0}/docs/project-setup/how-to/schema-config.md +0 -0
  102. {datasight-0.7.0 → datasight-0.8.0}/docs/project-setup/how-to/schema-description.md +0 -0
  103. {datasight-0.7.0 → datasight-0.8.0}/docs/project-setup/how-to/validation-rules.md +0 -0
  104. {datasight-0.7.0 → datasight-0.8.0}/docs/project-setup/how-to/verification.md +0 -0
  105. {datasight-0.7.0 → datasight-0.8.0}/docs/project-setup/tutorials/set-up-project.md +0 -0
  106. {datasight-0.7.0 → datasight-0.8.0}/docs/project-setup/tutorials/time-validation.md +0 -0
  107. {datasight-0.7.0 → datasight-0.8.0}/docs/reference/configuration.md +0 -0
  108. {datasight-0.7.0 → datasight-0.8.0}/docs/reference/keyboard-shortcuts.md +0 -0
  109. {datasight-0.7.0 → datasight-0.8.0}/docs/reference/query-confidence-toggles.md +0 -0
  110. {datasight-0.7.0 → datasight-0.8.0}/docs/reference/web-ui.md +0 -0
  111. {datasight-0.7.0 → datasight-0.8.0}/docs/stylesheets/extra.css +0 -0
  112. {datasight-0.7.0 → datasight-0.8.0}/docs/use/concepts/choosing-an-llm.md +0 -0
  113. {datasight-0.7.0 → datasight-0.8.0}/docs/use/concepts/query-confidence.md +0 -0
  114. {datasight-0.7.0 → datasight-0.8.0}/docs/use/concepts/trusting-ai-results.md +0 -0
  115. {datasight-0.7.0 → datasight-0.8.0}/docs/use/how-to/ask-in-web-ui.md +0 -0
  116. {datasight-0.7.0 → datasight-0.8.0}/docs/use/how-to/build-a-dashboard.md +0 -0
  117. {datasight-0.7.0 → datasight-0.8.0}/docs/use/how-to/connect-flight-sql.md +0 -0
  118. {datasight-0.7.0 → datasight-0.8.0}/docs/use/how-to/connect-spark.md +0 -0
  119. {datasight-0.7.0 → datasight-0.8.0}/docs/use/how-to/create-visualizations.md +0 -0
  120. {datasight-0.7.0 → datasight-0.8.0}/docs/use/how-to/explore-files.md +0 -0
  121. {datasight-0.7.0 → datasight-0.8.0}/docs/use/how-to/install.md +0 -0
  122. {datasight-0.7.0 → datasight-0.8.0}/docs/use/how-to/review-query-log.md +0 -0
  123. {datasight-0.7.0 → datasight-0.8.0}/docs/use/how-to/run-on-hpc.md +0 -0
  124. {datasight-0.7.0 → datasight-0.8.0}/docs/use/how-to/save-dashboard-template.md +0 -0
  125. {datasight-0.7.0 → datasight-0.8.0}/docs/use/tutorials/getting-started.md +0 -0
  126. {datasight-0.7.0 → datasight-0.8.0}/docs/use/tutorials/tempo.md +0 -0
  127. {datasight-0.7.0 → datasight-0.8.0}/frontend/e2e/screenshots.spec.ts +0 -0
  128. {datasight-0.7.0 → datasight-0.8.0}/frontend/e2e/smoke.spec.ts +0 -0
  129. {datasight-0.7.0 → datasight-0.8.0}/frontend/index.html +0 -0
  130. {datasight-0.7.0 → datasight-0.8.0}/frontend/package-lock.json +0 -0
  131. {datasight-0.7.0 → datasight-0.8.0}/frontend/package.json +0 -0
  132. {datasight-0.7.0 → datasight-0.8.0}/frontend/playwright.config.ts +0 -0
  133. {datasight-0.7.0 → datasight-0.8.0}/frontend/public/datasight-icon.svg +0 -0
  134. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/app.css +0 -0
  135. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/assets/datasight-icon.svg +0 -0
  136. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/lib/api/chat.ts +0 -0
  137. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/lib/api/client.ts +0 -0
  138. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/lib/api/dashboard.ts +0 -0
  139. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/lib/api/measures.ts +0 -0
  140. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/lib/api/projects.ts +0 -0
  141. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/lib/api/saved.ts +0 -0
  142. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/lib/api/schema.ts +0 -0
  143. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/lib/api/settings.ts +0 -0
  144. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/lib/api/sql.ts +0 -0
  145. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/lib/api/starters.ts +0 -0
  146. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/lib/api/summarize.ts +0 -0
  147. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/lib/components/AddFilesInput.svelte +0 -0
  148. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/lib/components/BookmarksList.svelte +0 -0
  149. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/lib/components/ChartResult.svelte +0 -0
  150. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/lib/components/ChatInput.svelte +0 -0
  151. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/lib/components/ChatView.svelte +0 -0
  152. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/lib/components/ClarifyOptions.svelte +0 -0
  153. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/lib/components/CodeEditor.svelte +0 -0
  154. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/lib/components/DashboardGrid.svelte +0 -0
  155. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/lib/components/DashboardNote.svelte +0 -0
  156. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/lib/components/DashboardSection.svelte +0 -0
  157. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/lib/components/DashboardToolbar.svelte +0 -0
  158. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/lib/components/DashboardView.svelte +0 -0
  159. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/lib/components/DiscoveredFilesCard.svelte +0 -0
  160. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/lib/components/ExploreCard.svelte +0 -0
  161. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/lib/components/Header.svelte +0 -0
  162. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/lib/components/LandingPage.svelte +0 -0
  163. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/lib/components/LlmConfigForm.svelte +0 -0
  164. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/lib/components/MeasureEditor.svelte +0 -0
  165. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/lib/components/MeasureEditorModal.svelte +0 -0
  166. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/lib/components/MessageBubble.svelte +0 -0
  167. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/lib/components/PlotlyChart.svelte +0 -0
  168. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/lib/components/ProjectCard.svelte +0 -0
  169. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/lib/components/ProjectHealth.svelte +0 -0
  170. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/lib/components/ProjectsPanel.svelte +0 -0
  171. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/lib/components/QueriesList.svelte +0 -0
  172. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/lib/components/QueryHistoryPanel.svelte +0 -0
  173. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/lib/components/RecipesList.svelte +0 -0
  174. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/lib/components/ReportsList.svelte +0 -0
  175. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/lib/components/RunDetails.svelte +0 -0
  176. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/lib/components/SaveProjectModal.svelte +0 -0
  177. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/lib/components/SchemaInspector.svelte +0 -0
  178. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/lib/components/SettingsPanel.svelte +0 -0
  179. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/lib/components/Sidebar.svelte +0 -0
  180. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/lib/components/SidebarSection.svelte +0 -0
  181. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/lib/components/SqlConfirmDialog.svelte +0 -0
  182. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/lib/components/SqlView.svelte +0 -0
  183. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/lib/components/StarterGrid.svelte +0 -0
  184. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/lib/components/StarterOverview.svelte +0 -0
  185. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/lib/components/SuggestionButtons.svelte +0 -0
  186. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/lib/components/TableResult.svelte +0 -0
  187. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/lib/components/Toast.svelte +0 -0
  188. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/lib/components/ToolIndicator.svelte +0 -0
  189. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/lib/stores/chat.svelte.ts +0 -0
  190. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/lib/stores/dashboard.svelte.ts +0 -0
  191. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/lib/stores/palette.svelte.ts +0 -0
  192. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/lib/stores/queries.svelte.ts +0 -0
  193. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/lib/stores/schema.svelte.ts +0 -0
  194. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/lib/stores/session.svelte.ts +0 -0
  195. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/lib/stores/settings.svelte.ts +0 -0
  196. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/lib/stores/sidebar.svelte.ts +0 -0
  197. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/lib/stores/sql_editor.svelte.ts +0 -0
  198. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/lib/stores/toast.svelte.ts +0 -0
  199. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/lib/types/plotly-js-dist-min.d.ts +0 -0
  200. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/lib/types/plotly.ts +0 -0
  201. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/lib/utils/emacs-keys.ts +0 -0
  202. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/lib/utils/format.ts +0 -0
  203. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/lib/utils/markdown.ts +0 -0
  204. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/lib/utils/search.ts +0 -0
  205. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/lib/utils/sql-completion.ts +0 -0
  206. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/main.ts +0 -0
  207. {datasight-0.7.0 → datasight-0.8.0}/frontend/src/vite-env.d.ts +0 -0
  208. {datasight-0.7.0 → datasight-0.8.0}/frontend/svelte.config.js +0 -0
  209. {datasight-0.7.0 → datasight-0.8.0}/frontend/tests/chat.test.ts +0 -0
  210. {datasight-0.7.0 → datasight-0.8.0}/frontend/tests/emacs-keys.test.ts +0 -0
  211. {datasight-0.7.0 → datasight-0.8.0}/frontend/tests/format.test.ts +0 -0
  212. {datasight-0.7.0 → datasight-0.8.0}/frontend/tests/replay.test.ts +0 -0
  213. {datasight-0.7.0 → datasight-0.8.0}/frontend/tests/search.test.ts +0 -0
  214. {datasight-0.7.0 → datasight-0.8.0}/frontend/tests/sql-completion.test.ts +0 -0
  215. {datasight-0.7.0 → datasight-0.8.0}/frontend/tests/stores.test.ts +0 -0
  216. {datasight-0.7.0 → datasight-0.8.0}/frontend/tests/summarize.test.ts +0 -0
  217. {datasight-0.7.0 → datasight-0.8.0}/frontend/tsconfig.json +0 -0
  218. {datasight-0.7.0 → datasight-0.8.0}/frontend/vite.config.ts +0 -0
  219. {datasight-0.7.0 → datasight-0.8.0}/frontend/vitest.config.ts +0 -0
  220. {datasight-0.7.0 → datasight-0.8.0}/scripts/build-frontend.sh +0 -0
  221. {datasight-0.7.0 → datasight-0.8.0}/scripts/generate_cli_reference.py +0 -0
  222. {datasight-0.7.0 → datasight-0.8.0}/src/datasight/__init__.py +0 -0
  223. {datasight-0.7.0 → datasight-0.8.0}/src/datasight/__main__.py +0 -0
  224. {datasight-0.7.0 → datasight-0.8.0}/src/datasight/agent.py +0 -0
  225. {datasight-0.7.0 → datasight-0.8.0}/src/datasight/audit_report.py +0 -0
  226. {datasight-0.7.0 → datasight-0.8.0}/src/datasight/chart.py +0 -0
  227. {datasight-0.7.0 → datasight-0.8.0}/src/datasight/cli_commands/__init__.py +0 -0
  228. {datasight-0.7.0 → datasight-0.8.0}/src/datasight/config.py +0 -0
  229. {datasight-0.7.0 → datasight-0.8.0}/src/datasight/cost.py +0 -0
  230. {datasight-0.7.0 → datasight-0.8.0}/src/datasight/dashboard_template.py +0 -0
  231. {datasight-0.7.0 → datasight-0.8.0}/src/datasight/data_profile.py +0 -0
  232. {datasight-0.7.0 → datasight-0.8.0}/src/datasight/demo.py +0 -0
  233. {datasight-0.7.0 → datasight-0.8.0}/src/datasight/demo_dsgrid_tempo.py +0 -0
  234. {datasight-0.7.0 → datasight-0.8.0}/src/datasight/demo_time_validation.py +0 -0
  235. {datasight-0.7.0 → datasight-0.8.0}/src/datasight/distribution.py +0 -0
  236. {datasight-0.7.0 → datasight-0.8.0}/src/datasight/events.py +0 -0
  237. {datasight-0.7.0 → datasight-0.8.0}/src/datasight/exceptions.py +0 -0
  238. {datasight-0.7.0 → datasight-0.8.0}/src/datasight/generate.py +0 -0
  239. {datasight-0.7.0 → datasight-0.8.0}/src/datasight/identifiers.py +0 -0
  240. {datasight-0.7.0 → datasight-0.8.0}/src/datasight/integrity.py +0 -0
  241. {datasight-0.7.0 → datasight-0.8.0}/src/datasight/llm.py +0 -0
  242. {datasight-0.7.0 → datasight-0.8.0}/src/datasight/prompts.py +0 -0
  243. {datasight-0.7.0 → datasight-0.8.0}/src/datasight/query_log.py +0 -0
  244. {datasight-0.7.0 → datasight-0.8.0}/src/datasight/recent_projects.py +0 -0
  245. {datasight-0.7.0 → datasight-0.8.0}/src/datasight/runner.py +0 -0
  246. {datasight-0.7.0 → datasight-0.8.0}/src/datasight/schema.py +0 -0
  247. {datasight-0.7.0 → datasight-0.8.0}/src/datasight/schema_links.py +0 -0
  248. {datasight-0.7.0 → datasight-0.8.0}/src/datasight/schema_types.py +0 -0
  249. {datasight-0.7.0 → datasight-0.8.0}/src/datasight/settings.py +0 -0
  250. {datasight-0.7.0 → datasight-0.8.0}/src/datasight/sql_validation.py +0 -0
  251. {datasight-0.7.0 → datasight-0.8.0}/src/datasight/templates/env.template +0 -0
  252. {datasight-0.7.0 → datasight-0.8.0}/src/datasight/templates/global_env.template +0 -0
  253. {datasight-0.7.0 → datasight-0.8.0}/src/datasight/templates/html/audit_report.mustache +0 -0
  254. {datasight-0.7.0 → datasight-0.8.0}/src/datasight/templates/html/chart.mustache +0 -0
  255. {datasight-0.7.0 → datasight-0.8.0}/src/datasight/templates/html/export_dashboard.mustache +0 -0
  256. {datasight-0.7.0 → datasight-0.8.0}/src/datasight/templates/html/export_session.mustache +0 -0
  257. {datasight-0.7.0 → datasight-0.8.0}/src/datasight/templates/html/export_session_python.mustache +0 -0
  258. {datasight-0.7.0 → datasight-0.8.0}/src/datasight/templates/queries.yaml +0 -0
  259. {datasight-0.7.0 → datasight-0.8.0}/src/datasight/templates/schema_description.md +0 -0
  260. {datasight-0.7.0 → datasight-0.8.0}/src/datasight/templates/time_series.yaml +0 -0
  261. {datasight-0.7.0 → datasight-0.8.0}/src/datasight/templates/validation.yaml +0 -0
  262. {datasight-0.7.0 → datasight-0.8.0}/src/datasight/templating.py +0 -0
  263. {datasight-0.7.0 → datasight-0.8.0}/src/datasight/validation.py +0 -0
  264. {datasight-0.7.0 → datasight-0.8.0}/src/datasight/verify.py +0 -0
  265. {datasight-0.7.0 → datasight-0.8.0}/src/datasight/web/__init__.py +0 -0
  266. {datasight-0.7.0 → datasight-0.8.0}/src/datasight/web/static/assets/index-DyflbovG.css +0 -0
  267. {datasight-0.7.0 → datasight-0.8.0}/src/datasight/web/static/datasight-icon.svg +0 -0
  268. {datasight-0.7.0 → datasight-0.8.0}/tests/__init__.py +0 -0
  269. {datasight-0.7.0 → datasight-0.8.0}/tests/_env_helpers.py +0 -0
  270. {datasight-0.7.0 → datasight-0.8.0}/tests/conftest.py +0 -0
  271. {datasight-0.7.0 → datasight-0.8.0}/tests/test_agent.py +0 -0
  272. {datasight-0.7.0 → datasight-0.8.0}/tests/test_agent_extra.py +0 -0
  273. {datasight-0.7.0 → datasight-0.8.0}/tests/test_audit.py +0 -0
  274. {datasight-0.7.0 → datasight-0.8.0}/tests/test_audit_report_extra.py +0 -0
  275. {datasight-0.7.0 → datasight-0.8.0}/tests/test_caching_runner.py +0 -0
  276. {datasight-0.7.0 → datasight-0.8.0}/tests/test_cli_ask.py +0 -0
  277. {datasight-0.7.0 → datasight-0.8.0}/tests/test_config.py +0 -0
  278. {datasight-0.7.0 → datasight-0.8.0}/tests/test_config_extra.py +0 -0
  279. {datasight-0.7.0 → datasight-0.8.0}/tests/test_dashboard_template.py +0 -0
  280. {datasight-0.7.0 → datasight-0.8.0}/tests/test_data_profile_extra.py +0 -0
  281. {datasight-0.7.0 → datasight-0.8.0}/tests/test_distribution.py +0 -0
  282. {datasight-0.7.0 → datasight-0.8.0}/tests/test_docs_cli_reference.py +0 -0
  283. {datasight-0.7.0 → datasight-0.8.0}/tests/test_explore.py +0 -0
  284. {datasight-0.7.0 → datasight-0.8.0}/tests/test_explore_spark.py +0 -0
  285. {datasight-0.7.0 → datasight-0.8.0}/tests/test_export_extra.py +0 -0
  286. {datasight-0.7.0 → datasight-0.8.0}/tests/test_generate.py +0 -0
  287. {datasight-0.7.0 → datasight-0.8.0}/tests/test_generate_extra.py +0 -0
  288. {datasight-0.7.0 → datasight-0.8.0}/tests/test_identifiers.py +0 -0
  289. {datasight-0.7.0 → datasight-0.8.0}/tests/test_integrity.py +0 -0
  290. {datasight-0.7.0 → datasight-0.8.0}/tests/test_llm.py +0 -0
  291. {datasight-0.7.0 → datasight-0.8.0}/tests/test_prompts.py +0 -0
  292. {datasight-0.7.0 → datasight-0.8.0}/tests/test_query_log.py +0 -0
  293. {datasight-0.7.0 → datasight-0.8.0}/tests/test_recent_projects.py +0 -0
  294. {datasight-0.7.0 → datasight-0.8.0}/tests/test_runner.py +0 -0
  295. {datasight-0.7.0 → datasight-0.8.0}/tests/test_runner_extra.py +0 -0
  296. {datasight-0.7.0 → datasight-0.8.0}/tests/test_schema.py +0 -0
  297. {datasight-0.7.0 → datasight-0.8.0}/tests/test_schema_config_load.py +0 -0
  298. {datasight-0.7.0 → datasight-0.8.0}/tests/test_schema_extra.py +0 -0
  299. {datasight-0.7.0 → datasight-0.8.0}/tests/test_schema_filter.py +0 -0
  300. {datasight-0.7.0 → datasight-0.8.0}/tests/test_schema_links.py +0 -0
  301. {datasight-0.7.0 → datasight-0.8.0}/tests/test_settings.py +0 -0
  302. {datasight-0.7.0 → datasight-0.8.0}/tests/test_settings_extra.py +0 -0
  303. {datasight-0.7.0 → datasight-0.8.0}/tests/test_spark_runner.py +0 -0
  304. {datasight-0.7.0 → datasight-0.8.0}/tests/test_sql_validation.py +0 -0
  305. {datasight-0.7.0 → datasight-0.8.0}/tests/test_sql_validation_extra.py +0 -0
  306. {datasight-0.7.0 → datasight-0.8.0}/tests/test_time_series.py +0 -0
  307. {datasight-0.7.0 → datasight-0.8.0}/tests/test_validation.py +0 -0
  308. {datasight-0.7.0 → datasight-0.8.0}/tests/test_verify.py +0 -0
  309. {datasight-0.7.0 → datasight-0.8.0}/tests/test_web_app.py +0 -0
  310. {datasight-0.7.0 → datasight-0.8.0}/tests/test_web_ui_smoke.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: datasight
3
- Version: 0.7.0
3
+ Version: 0.8.0
4
4
  Summary: AI-powered data exploration with natural language
5
5
  Project-URL: Repository, https://github.com/dsgrid/datasight
6
6
  Project-URL: Documentation, https://dsgrid.github.io/datasight/
@@ -164,8 +164,9 @@ sequenceDiagram
164
164
  descriptions and example queries from raw data files.
165
165
 
166
166
  `datasight.export`
167
- : Converts a conversation session into a self-contained HTML page with
168
- inline CSS, Plotly charts, and syntax-highlighted SQL.
167
+ : Converts a conversation session into self-contained exports: HTML,
168
+ runnable Python, and portable bundle archives with SQL, CSV extracts,
169
+ Plotly specs, and provenance metadata.
169
170
 
170
171
  `datasight.web.app`
171
172
  : FastAPI application with SSE streaming, tool execution, and REST API
@@ -58,11 +58,13 @@ datasight [OPTIONS] COMMAND [ARGS]...
58
58
  - `demo`: Create ready-to-run demo projects with sample datasets.
59
59
  - `generate`: Generate schema_description.md, queries.yaml, measures.yaml, and time_series.yaml from your database.
60
60
  - `run`: Start the datasight web UI.
61
+ - `session`: Export and import shareable datasight session archives.
61
62
  - `verify`: Verify LLM-generated SQL against expected results.
62
63
  - `ask`: Ask a question about your data from the command line.
63
64
  - `profile`: Profile your dataset - row counts, date coverage, and column statistics.
64
65
  - `measures`: Surface likely measures and default aggregations.
65
66
  - `quality`: Audit data quality - nulls, suspicious ranges, and date coverage.
67
+ - `tidy`: Detect untidy column shapes and reshape into long form.
66
68
  - `integrity`: Audit cross-table referential integrity - keys, orphans, and join risks.
67
69
  - `distribution`: Profile value distributions - percentiles, outliers, and measure flags.
68
70
  - `validate`: Run declarative validation rules against the database.
@@ -317,6 +319,7 @@ datasight generate [OPTIONS] [FILES]...
317
319
  | `--overwrite` | Overwrite existing files. |
318
320
  | `--table`, `-t` | Table or view to include (can be specified multiple times). If omitted, all tables are included. |
319
321
  | `--db-path` | Output DuckDB path to create from CSV/Parquet/Excel or mixed file inputs (default: database.duckdb). Do not use this with a single existing DuckDB or SQLite database; those are referenced directly. |
322
+ | `--import-mode` | When FILES are CSV/Parquet inputs, choose whether datasight creates source-backed views or materialized DuckDB tables. 'auto' preserves the existing cheap behavior and keeps CSV/Parquet source-backed; use 'table' to opt into materialization. Excel workbooks are always materialized as tables. Default: `auto`. |
320
323
  | `--compact-schema` | Write schema.yaml with table names only. Default adds an empty 'excluded_columns: []' placeholder per table so you can fill in glob patterns for columns to hide. |
321
324
  | `-v`, `--verbose` | Enable debug logging. |
322
325
 
@@ -352,6 +355,80 @@ datasight run [OPTIONS]
352
355
  | `--project-dir` | Auto-load this project on startup (optional). |
353
356
  | `-v`, `--verbose` | Enable debug logging. |
354
357
 
358
+ ### `datasight session`
359
+
360
+ Export and import shareable datasight session archives.
361
+
362
+ Archives carry the conversation transcript and per-session dashboard
363
+ only — never .env or LLM credentials, and never the underlying
364
+ database. Recipients need to bring their own data.
365
+
366
+ Examples:
367
+
368
+ ```
369
+ datasight session list
370
+ datasight session export abc123 --output-path analysis.zip
371
+ datasight session import analysis.zip
372
+ datasight session import analysis.zip --session-id copied-session --overwrite
373
+ ```
374
+
375
+ ```bash
376
+ datasight session [OPTIONS] COMMAND [ARGS]...
377
+ ```
378
+
379
+ **Subcommands**
380
+
381
+ - `list`: List saved sessions available for export.
382
+ - `export`: Export SESSION_ID as a versioned datasight session archive.
383
+ - `import`: Import a datasight session archive into PROJECT_DIR.
384
+
385
+ #### `datasight session list`
386
+
387
+ List saved sessions available for export.
388
+
389
+ ```bash
390
+ datasight session list [OPTIONS]
391
+ ```
392
+
393
+ **Parameters**
394
+
395
+ | Name | Details |
396
+ | --- | --- |
397
+ | `--project-dir` | Project directory containing .datasight/ state (default: cwd). Default: `.`. |
398
+
399
+ #### `datasight session export`
400
+
401
+ Export SESSION_ID as a versioned datasight session archive.
402
+
403
+ ```bash
404
+ datasight session export [OPTIONS] SESSION_ID
405
+ ```
406
+
407
+ **Parameters**
408
+
409
+ | Name | Details |
410
+ | --- | --- |
411
+ | `SESSION_ID` | |
412
+ | `--project-dir` | Project directory containing .datasight/ state (default: cwd). Default: `.`. |
413
+ | `--output-path` | Output archive path. Defaults to <session_id>.zip in the current directory. |
414
+
415
+ #### `datasight session import`
416
+
417
+ Import a datasight session archive into PROJECT_DIR.
418
+
419
+ ```bash
420
+ datasight session import [OPTIONS] ARCHIVE_PATH
421
+ ```
422
+
423
+ **Parameters**
424
+
425
+ | Name | Details |
426
+ | --- | --- |
427
+ | `ARCHIVE_PATH` | |
428
+ | `--project-dir` | Project directory containing .datasight/ state (default: cwd). Default: `.`. |
429
+ | `--session-id` | Import under this session ID instead of the archived ID. |
430
+ | `--overwrite` | Replace an existing session with the same ID. |
431
+
355
432
  ### `datasight verify`
356
433
 
357
434
  Verify LLM-generated SQL against expected results.
@@ -525,6 +602,115 @@ datasight quality [OPTIONS]
525
602
  | `--format` | Output format (default: table). Default: `table`. |
526
603
  | `--output`, `-o` | Write the quality audit to a file instead of stdout. |
527
604
 
605
+ ### `datasight tidy`
606
+
607
+ Detect untidy column shapes and reshape into long form.
608
+
609
+ Use 'tidy suggest' to inspect candidates, 'tidy view' to create
610
+ long-form views, or 'tidy table' to materialize long-form tables.
611
+ Detection is deterministic — column names plus dtypes plus row counts —
612
+ so no LLM is involved.
613
+
614
+ Examples:
615
+
616
+ ```
617
+ datasight tidy suggest
618
+ datasight tidy suggest --table sales_wide
619
+ datasight tidy view --dry-run
620
+ datasight tidy view
621
+ datasight tidy table --table sales_wide
622
+ ```
623
+
624
+ ```bash
625
+ datasight tidy [OPTIONS] COMMAND [ARGS]...
626
+ ```
627
+
628
+ **Subcommands**
629
+
630
+ - `suggest`: List detected untidy column shapes without changing the database.
631
+ - `view`: Create CREATE OR REPLACE VIEW <table>_long for each detected pattern.
632
+ - `table`: Materialize CREATE OR REPLACE TABLE <table>_long for each detected pattern.
633
+
634
+ #### `datasight tidy suggest`
635
+
636
+ List detected untidy column shapes without changing the database.
637
+
638
+ Pass one or more CSV / Parquet / Excel / DuckDB files as positional
639
+ arguments to inspect them in an ephemeral session — no project setup
640
+ required. With no files, runs against the current project's database.
641
+
642
+ Examples:
643
+
644
+ ```
645
+ datasight tidy suggest # current project
646
+ datasight tidy suggest monthly_generation.csv # standalone file
647
+ datasight tidy suggest gen.csv plants.parquet # multiple files
648
+ datasight tidy suggest --table sales_wide
649
+ datasight tidy suggest --format markdown -o tidy.md
650
+ ```
651
+
652
+ ```bash
653
+ datasight tidy suggest [OPTIONS] [FILES]...
654
+ ```
655
+
656
+ **Parameters**
657
+
658
+ | Name | Details |
659
+ | --- | --- |
660
+ | `FILES` | |
661
+ | `--project-dir` | Project directory containing .env and config files. Default: `.`. |
662
+ | `--table` | Scope tidy detection to a specific source table. |
663
+ | `--format` | Output format (default: table). Default: `table`. |
664
+ | `--output`, `-o` | Write the tidy listing to a file instead of stdout. |
665
+
666
+ #### `datasight tidy view`
667
+
668
+ Create CREATE OR REPLACE VIEW <table>_long for each detected pattern.
669
+
670
+ Examples:
671
+
672
+ ```
673
+ datasight tidy view
674
+ datasight tidy view --dry-run
675
+ datasight tidy view --table sales_wide
676
+ ```
677
+
678
+ ```bash
679
+ datasight tidy view [OPTIONS]
680
+ ```
681
+
682
+ **Parameters**
683
+
684
+ | Name | Details |
685
+ | --- | --- |
686
+ | `--project-dir` | Project directory containing .env and config files. Default: `.`. |
687
+ | `--table` | Scope tidy detection to a specific source table. |
688
+ | `--dry-run` | Print the DDL without executing it. |
689
+
690
+ #### `datasight tidy table`
691
+
692
+ Materialize CREATE OR REPLACE TABLE <table>_long for each detected pattern.
693
+
694
+ Examples:
695
+
696
+ ```
697
+ datasight tidy table
698
+ datasight tidy table --dry-run
699
+ datasight tidy table --table sales_wide
700
+ ```
701
+
702
+ ```bash
703
+ datasight tidy table [OPTIONS]
704
+ ```
705
+
706
+ **Parameters**
707
+
708
+ | Name | Details |
709
+ | --- | --- |
710
+ | `--project-dir` | Project directory containing .env and config files. Default: `.`. |
711
+ | `--table` | Scope tidy detection to a specific source table. |
712
+ | `--dry-run` | Print the DDL without executing it. |
713
+
528
714
  ### `datasight integrity`
529
715
 
530
716
  Audit cross-table referential integrity - keys, orphans, and join risks.
@@ -854,6 +1040,7 @@ Examples:
854
1040
  datasight export --list-sessions
855
1041
  datasight export abc123def -o my-analysis.html
856
1042
  datasight export abc123def --format py -o my-analysis.py
1043
+ datasight export abc123def --format bundle -o analysis-bundle.zip
857
1044
  datasight export abc123def --exclude 2,3
858
1045
  ```
859
1046
 
@@ -867,7 +1054,8 @@ datasight export [OPTIONS] [SESSION_ID]
867
1054
  | --- | --- |
868
1055
  | `SESSION_ID` | |
869
1056
  | `--output`, `-o` | Output file path. Defaults to <session_id>.<format> with the session ID truncated to 20 characters. |
870
- | `--format` | html (self-contained viewer, default) or py (runnable Python script). Default: `html`. |
1057
+ | `--format` | html (viewer), py (runnable script), or bundle (zip archive with artifacts). Default: `html`. |
1058
+ | `--include` | Bundle-only: comma-separated artifacts to include. Choices: html,sql,python,csv,charts,metadata. Default: all. |
871
1059
  | `--project-dir` | Project directory containing .datasight/conversations/. Default: `.`. |
872
1060
  | `--exclude` | Comma-separated turn indices to exclude (0-based, each turn is a Q&A pair). |
873
1061
  | `--list-sessions` | List available sessions and exit. |
@@ -173,6 +173,9 @@ datasight export --list-sessions
173
173
  # Export a conversation to HTML
174
174
  datasight export a1b2c3d4 -o analysis.html
175
175
 
176
+ # Export a portable bundle archive
177
+ datasight export a1b2c3d4 --format bundle -o analysis.zip
178
+
176
179
  # Exclude specific turns by index (0-based)
177
180
  datasight export e5f6g7h8 --exclude 0,3 -o wind-report.html
178
181
  ```
@@ -63,6 +63,131 @@ Use it to spot:
63
63
  - quick notes worth turning into follow-up questions
64
64
  - temporal completeness issues when [`time_series.yaml`](../../project-setup/how-to/declare-time-series.md) is present
65
65
 
66
+ ## Detect untidy column shapes
67
+
68
+ `datasight quality` also flags tables whose **column names encode dimension
69
+ values** — a common spreadsheet shape that confuses both DuckDB and the LLM
70
+ agent. To list, preview, or apply reshapes, use the dedicated
71
+ `datasight tidy` command described below.
72
+
73
+ ### What "tidy" means
74
+
75
+ A *tidy* dataset, as defined by Hadley Wickham in [Tidy
76
+ Data](https://www.jstatsoft.org/article/view/v059i10) (J. Stat. Softw., 2014),
77
+ follows three rules:
78
+
79
+ 1. each variable forms a column,
80
+ 2. each observation forms a row,
81
+ 3. each type of observational unit forms a table.
82
+
83
+ In a tidy `generation_fuel` table, that means one row per *(plant, date, fuel)*
84
+ observation, with `net_generation_mwh` as a single column — not 12 columns
85
+ named `jan`, `feb`, `mar`, … or 24 columns named `hour_00`, `hour_01`, ….
86
+ When dimension values (year, month, quarter, hour, day) live in the column
87
+ headers, the data is *untidy* and queries become awkward (e.g. "average across
88
+ months" turns into a SUM across 12 columns instead of a `GROUP BY month`).
89
+
90
+ For a longer treatment with worked examples, the R for Data Science chapter
91
+ [Data tidying](https://r4ds.hadley.nz/data-tidy) walks through the same ideas
92
+ with concrete reshapes.
93
+
94
+ ### What datasight detects
95
+
96
+ The `quality` command flags two structural patterns from the schema alone — no
97
+ extra SQL is issued:
98
+
99
+ - **Period values in column names** — three or more columns whose names match
100
+ a recognized year, year-month, year-quarter, quarter, month, hour, or day
101
+ token. Both shared-prefix shapes (`sales_2020`, `sales_2021`, `sales_2022`)
102
+ and bare-token shapes (`q1`, `q2`, `q3`, `q4` or `hour_00` … `hour_23`) are
103
+ recognized.
104
+ - **Wide tables with low row counts** — tables with 30 or more columns where
105
+ the row count is comparable to the column count. This is a softer note,
106
+ emitted only when no period pattern is detected.
107
+
108
+ ### List suggestions: `datasight tidy suggest`
109
+
110
+ To inspect the suggestions on their own, use:
111
+
112
+ ```bash
113
+ datasight tidy suggest # current project
114
+ datasight tidy suggest sales_wide.csv # standalone file, no project
115
+ datasight tidy suggest gen.csv plants.parquet # multiple files
116
+ datasight tidy suggest --table sales_wide
117
+ datasight tidy suggest --format markdown -o tidy.md
118
+ ```
119
+
120
+ When you pass file arguments, datasight registers them in an ephemeral
121
+ DuckDB session and skips project loading entirely — useful for the "is
122
+ this spreadsheet untidy?" question before committing to project setup.
123
+
124
+ Example output:
125
+
126
+ ```
127
+ $ datasight tidy suggest --table sales_wide --format markdown
128
+ # Tidy Reshape Suggestions
129
+
130
+ - Tables scanned: 1
131
+
132
+ ## Suggestions
133
+ - `sales_wide` (repeated_prefix_period, year, 4 columns): Columns share prefix
134
+ `sales` with year suffixes — 4 columns look like a single measure spread
135
+ across year values.
136
+
137
+ ```sql
138
+ CREATE OR REPLACE TABLE "sales_wide_long" AS
139
+ SELECT * FROM (
140
+ UNPIVOT "sales_wide"
141
+ ON "sales_2020" AS '2020',
142
+ "sales_2021" AS '2021',
143
+ "sales_2022" AS '2022',
144
+ "sales_2023" AS '2023'
145
+ INTO
146
+ NAME "year"
147
+ VALUE "sales"
148
+ );
149
+ ```
150
+ ```
151
+
152
+ ### Apply a reshape: `datasight tidy view` / `tidy table`
153
+
154
+ Two sibling subcommands write the long-form object directly to the project's
155
+ DuckDB database. Both accept `--dry-run` to preview the DDL without executing
156
+ it:
157
+
158
+ ```bash
159
+ # Materialize a physical table — the recommended default
160
+ datasight tidy table
161
+
162
+ # Preview the table DDL first
163
+ datasight tidy table --dry-run
164
+
165
+ # Or create a view that re-evaluates against the source on every query
166
+ datasight tidy view
167
+
168
+ # Scope to a single source table
169
+ datasight tidy table --table sales_wide
170
+ ```
171
+
172
+ The default target name is `<source_table>_long`; existing objects with that
173
+ name are replaced. After the table or view exists, reference it in your
174
+ `schema_description.md` so the LLM agent prefers tidy queries like
175
+ `SELECT year, SUM(sales) FROM sales_wide_long GROUP BY year` over wide-column
176
+ arithmetic.
177
+
178
+ !!! note "Why view and table emit different SQL"
179
+ `tidy table` emits the canonical DuckDB `UNPIVOT` form. `tidy view`
180
+ falls back to `UNION ALL` branches because of a regression in the
181
+ Python `duckdb` 1.5.2 binding — UNPIVOT stored inside a view fails to
182
+ re-bind on a fresh connection through that binding, raising
183
+ `Binder Error: UNPIVOT name count mismatch`. The standalone `duckdb`
184
+ CLI 1.5.1 doesn't reproduce the failure, but every datasight query
185
+ path (the agent, the web UI, `datasight ask`) goes through the Python
186
+ binding, so views created without the workaround would break for any
187
+ in-datasight consumer. Materialized tables don't re-bind, so they
188
+ keep the cleaner form. Prefer `tidy table` unless you specifically
189
+ need the view's auto-update semantics.
190
+
66
191
  ## Find measures
67
192
 
68
193
  `datasight measures` infers likely metrics and their aggregation semantics:
@@ -237,7 +362,7 @@ directory name appears in the report title.
237
362
  For a thorough data quality audit, run the commands in this order:
238
363
 
239
364
  1. **Profile** — understand the shape of the data
240
- 2. **Quality** — find nulls, range issues, and date gaps
365
+ 2. **Quality** — find nulls, range issues, date gaps, and untidy column shapes
241
366
  3. **Integrity** — verify primary keys, foreign keys, and join behavior
242
367
  4. **Distribution** — inspect percentiles, outliers, and temporal spikes
243
368
  5. **Measures** — identify metrics and verify aggregation defaults
@@ -123,8 +123,15 @@ You can also export from the CLI:
123
123
 
124
124
  ```bash
125
125
  datasight export <session-id> --format py -o my-analysis.py
126
+ datasight export <session-id> --format bundle -o my-analysis.zip
127
+ datasight export <session-id> --format bundle --include html,sql,python,csv,charts,metadata
126
128
  ```
127
129
 
130
+ Bundle exports package the session into a portable zip archive with a
131
+ versioned `manifest.json`. Depending on `--include`, the archive can contain
132
+ the HTML report, runnable Python script, SQL scripts, CSV result extracts,
133
+ Plotly chart specs, and structured metadata for provenance and reruns.
134
+
128
135
  DuckDB and SQLite sessions get a fully-runnable connection block.
129
136
  Sessions backed by PostgreSQL or Flight SQL produce a script with a
130
137
  clearly-marked `run_sql` scaffold for you to wire up your own driver —
@@ -0,0 +1,165 @@
1
+ # Tidy a wide-month spreadsheet
2
+
3
+ This tutorial walks through detecting and reshaping an "untidy" CSV — the
4
+ kind of spreadsheet that arrives with one column per month, quarter, or
5
+ year — into a tidy long-form view that the LLM agent (and DuckDB) can
6
+ query naturally. Allow about five minutes. No API key required: every
7
+ step in this tutorial is deterministic.
8
+
9
+ For background on what "tidy" means, see Hadley Wickham's
10
+ [Tidy Data](https://www.jstatsoft.org/article/view/v059i10) (J. Stat.
11
+ Softw., 2014) or the [R for Data Science chapter on data
12
+ tidying](https://r4ds.hadley.nz/data-tidy).
13
+
14
+ ## 1. Install datasight
15
+
16
+ ```bash
17
+ uv tool install datasight
18
+ ```
19
+
20
+ Don't have [uv](https://docs.astral.sh/uv/) yet? See
21
+ [Install datasight](../how-to/install.md) for the one-line installer.
22
+
23
+ ## 2. Save a wide CSV
24
+
25
+ The CSV below mirrors a common spreadsheet shape: one row per plant, with
26
+ twelve numeric columns named `jan` through `dec` holding monthly net
27
+ generation (MWh).
28
+
29
+ ```bash
30
+ cat > monthly_generation.csv <<'EOF'
31
+ plant_id,fuel_type,jan,feb,mar,apr,may,jun,jul,aug,sep,oct,nov,dec
32
+ 1,coal,180,165,140,120,110,100,95,105,130,160,175,200
33
+ 2,gas,220,200,180,170,160,175,200,220,210,200,215,230
34
+ 3,wind,150,145,160,175,190,200,195,180,170,155,145,140
35
+ 4,solar,60,90,130,175,215,240,245,225,180,130,90,55
36
+ EOF
37
+ ```
38
+
39
+ This is the *untidy* shape: the `month` dimension is hidden in the column
40
+ headers, so a question like "average generation by month across plants"
41
+ becomes an awkward sum across twelve columns instead of a `GROUP BY`.
42
+
43
+ ## 3. Detect untidy column shapes — no setup required
44
+
45
+ Point `datasight tidy suggest` straight at the CSV. It runs in an
46
+ ephemeral DuckDB session, so no project directory or `.env` is needed:
47
+
48
+ ```bash
49
+ datasight tidy suggest monthly_generation.csv
50
+ ```
51
+
52
+ ```
53
+ Suggestions
54
+ ┏━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━┓
55
+ ┃ Source ┃ Target ┃ Pattern ┃ Period ┃ Columns ┃
56
+ ┡━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━┩
57
+ │ monthly_generation_mwh │ monthly_generation_mwh_long │ date_in_column_… │ month │ 12 │
58
+ └────────────────────────┴─────────────────────────────┴─────────────────────┴────────┴─────────┘
59
+ ```
60
+
61
+ datasight has spotted that twelve column names look like month tokens —
62
+ `jan`, `feb`, … `dec` — and proposes to reshape the table into a long
63
+ form named `monthly_generation_mwh_long`.
64
+
65
+ You can also pass several files at once, or `parquet` / `xlsx` / `duckdb`
66
+ sources:
67
+
68
+ ```bash
69
+ datasight tidy suggest data/*.csv
70
+ datasight tidy suggest hourly.parquet plants.duckdb
71
+ ```
72
+
73
+ ## 4. Set up a project to apply the reshape
74
+
75
+ `tidy suggest` is read-only and ephemeral, but applying the reshape
76
+ (`tidy view` or `tidy table`) needs a writable database. That means
77
+ loading the CSV into a DuckDB file and pointing a `.env` at it.
78
+
79
+ ```bash
80
+ mkdir tidy-tutorial && mv monthly_generation.csv tidy-tutorial && cd tidy-tutorial
81
+
82
+ uv run --with duckdb python -c "
83
+ import duckdb
84
+ conn = duckdb.connect('generation.duckdb')
85
+ conn.execute('CREATE TABLE monthly_generation_mwh AS SELECT * FROM read_csv_auto(\"monthly_generation.csv\")')
86
+ "
87
+
88
+ cat > .env <<'EOF'
89
+ DB_MODE=duckdb
90
+ DB_PATH=generation.duckdb
91
+ LLM_PROVIDER=anthropic
92
+ ANTHROPIC_API_KEY=stub
93
+ EOF
94
+ ```
95
+
96
+ `uv run --with duckdb` runs Python with DuckDB available without
97
+ installing it system-wide. The `tidy` command is fully deterministic and
98
+ doesn't call the LLM, so the `ANTHROPIC_API_KEY` value is a placeholder
99
+ here — replace it with a real key only when you're ready to start asking
100
+ questions.
101
+
102
+ ## 5. Preview the reshape SQL
103
+
104
+ Before writing anything to the database, see exactly what would run:
105
+
106
+ ```bash
107
+ datasight tidy table --dry-run
108
+ ```
109
+
110
+ You'll see a `CREATE OR REPLACE TABLE` statement built around a DuckDB
111
+ `UNPIVOT`. The id columns (`plant_id`, `fuel_type`) come through
112
+ automatically; the twelve wide measure columns are stacked into a
113
+ two-column `(month, value)` pair.
114
+
115
+ ## 6. Apply the reshape
116
+
117
+ When the preview looks right, drop the `--dry-run` flag:
118
+
119
+ ```bash
120
+ datasight tidy table
121
+ ```
122
+
123
+ ```
124
+ Created table 'monthly_generation_mwh_long' from monthly_generation_mwh (12 columns)
125
+ ```
126
+
127
+ `datasight tidy view` is also available if you want a view that
128
+ re-evaluates against the source on every query (useful when the source
129
+ table is updated periodically). Because of a regression in the Python
130
+ `duckdb` 1.5.2 binding that breaks UNPIVOT inside views, `tidy view`
131
+ emits a `UNION ALL` form instead — the result is identical but the SQL
132
+ is more verbose. Prefer `tidy table` unless you specifically need view
133
+ semantics.
134
+
135
+ ## 7. Query the tidy form
136
+
137
+ ```bash
138
+ uv run --with duckdb python -c "
139
+ import duckdb
140
+ conn = duckdb.connect('generation.duckdb', read_only=True)
141
+ rows = conn.execute('''
142
+ SELECT month, ROUND(AVG(value), 1) AS avg_mwh
143
+ FROM monthly_generation_mwh_long
144
+ GROUP BY month
145
+ ORDER BY month
146
+ ''').fetchall()
147
+ for month, avg in rows:
148
+ print(f'{month}: {avg}')
149
+ "
150
+ ```
151
+
152
+ The same question on the wide table would have required summing twelve
153
+ named columns by hand. With the long form, monthly aggregation is a
154
+ plain `GROUP BY`.
155
+
156
+ ## What's next
157
+
158
+ - **Point the agent at the long form.** Mention `monthly_generation_mwh_long`
159
+ and its columns in your `schema_description.md` so the LLM agent prefers
160
+ tidy queries. See [Write a schema description](../../project-setup/how-to/schema-description.md).
161
+ - **Audit the rest of your data.** [Audit data quality](../how-to/audit-data-quality.md)
162
+ covers `datasight quality`, which surfaces tidy suggestions alongside
163
+ null/range/date-coverage checks during routine audits.
164
+ - **Try a real dataset.** [Explore US electricity generation (EIA)](getting-started.md)
165
+ walks through the same loop on the PUDL EIA dataset.