briefing 0.2.4__tar.gz → 0.4.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 (236) hide show
  1. {briefing-0.2.4 → briefing-0.4.0}/.gitignore +1 -0
  2. {briefing-0.2.4 → briefing-0.4.0}/CHANGELOG.md +153 -1
  3. {briefing-0.2.4 → briefing-0.4.0}/PKG-INFO +20 -28
  4. {briefing-0.2.4 → briefing-0.4.0}/README.md +18 -9
  5. {briefing-0.2.4 → briefing-0.4.0}/pyproject.toml +9 -20
  6. briefing-0.4.0/src/briefing/__init__.py +303 -0
  7. {briefing-0.2.4 → briefing-0.4.0}/src/briefing/__main__.py +1 -1
  8. briefing-0.4.0/src/briefing/_cli.py +255 -0
  9. briefing-0.4.0/src/briefing/_version.py +4 -0
  10. {briefing-0.2.4 → briefing-0.4.0}/src/briefing/blocks/__init__.py +3 -0
  11. {briefing-0.2.4 → briefing-0.4.0}/src/briefing/blocks/asset.py +87 -16
  12. {briefing-0.2.4 → briefing-0.4.0}/src/briefing/blocks/banner.py +2 -11
  13. {briefing-0.2.4 → briefing-0.4.0}/src/briefing/blocks/base.py +5 -1
  14. briefing-0.4.0/src/briefing/blocks/files.py +136 -0
  15. {briefing-0.2.4 → briefing-0.4.0}/src/briefing/blocks/layout.py +37 -15
  16. {briefing-0.2.4 → briefing-0.4.0}/src/briefing/blocks/text.py +19 -9
  17. {briefing-0.2.4 → briefing-0.4.0}/src/briefing/export/_render.py +5 -3
  18. {briefing-0.2.4 → briefing-0.4.0}/src/briefing/lab/__init__.py +12 -2
  19. {briefing-0.2.4 → briefing-0.4.0}/src/briefing/lab/_blocks.py +117 -14
  20. {briefing-0.2.4 → briefing-0.4.0}/src/briefing/lab/_render_calendar.py +14 -8
  21. {briefing-0.2.4 → briefing-0.4.0}/src/briefing/lab/_render_profile.py +5 -3
  22. briefing-0.4.0/src/briefing/lab/_render_timeheatmap.py +261 -0
  23. {briefing-0.2.4 → briefing-0.4.0}/src/briefing/lab/static/calendar.js +38 -21
  24. {briefing-0.2.4 → briefing-0.4.0}/src/briefing/lab/static/lab.js +5 -1
  25. briefing-0.4.0/src/briefing/reference.md +325 -0
  26. briefing-0.4.0/src/briefing/renderers/copy_embed.py +39 -0
  27. briefing-0.4.0/src/briefing/renderers/css_scope.py +131 -0
  28. {briefing-0.2.4 → briefing-0.4.0}/src/briefing/renderers/formatting.py +13 -3
  29. briefing-0.4.0/src/briefing/renderers/fragment.py +179 -0
  30. {briefing-0.2.4 → briefing-0.4.0}/src/briefing/renderers/html.py +253 -34
  31. briefing-0.4.0/src/briefing/renderers/links.py +48 -0
  32. briefing-0.4.0/src/briefing/renderers/markup.py +116 -0
  33. briefing-0.4.0/src/briefing/renderers/pack.py +29 -0
  34. {briefing-0.2.4 → briefing-0.4.0}/src/briefing/renderers/plot.py +80 -12
  35. briefing-0.4.0/src/briefing/renderers/registry.py +204 -0
  36. briefing-0.4.0/src/briefing/renderers/size.py +118 -0
  37. briefing-0.4.0/src/briefing/renderers/table.py +370 -0
  38. briefing-0.4.0/src/briefing/schema/v1.json +2339 -0
  39. briefing-0.4.0/src/briefing/spec/__init__.py +148 -0
  40. briefing-0.4.0/src/briefing/spec/__main__.py +33 -0
  41. briefing-0.4.0/src/briefing/spec/_check.py +152 -0
  42. briefing-0.4.0/src/briefing/spec/_convert.py +472 -0
  43. briefing-0.4.0/src/briefing/spec/_data.py +243 -0
  44. briefing-0.4.0/src/briefing/spec/_diagnostic.py +81 -0
  45. briefing-0.4.0/src/briefing/spec/_model.py +420 -0
  46. briefing-0.4.0/src/briefing/spec/_reference.py +202 -0
  47. briefing-0.4.0/src/briefing/spec/_validate.py +208 -0
  48. briefing-0.4.0/src/briefing/static/copy-embed.css +72 -0
  49. briefing-0.4.0/src/briefing/static/copy-embed.js +173 -0
  50. briefing-0.4.0/src/briefing/static/embed-reset.css +33 -0
  51. briefing-0.4.0/src/briefing/static/embed.css +44 -0
  52. {briefing-0.2.4 → briefing-0.4.0}/src/briefing/static/export.js +21 -15
  53. {briefing-0.2.4 → briefing-0.4.0}/src/briefing/static/report.css +84 -6
  54. briefing-0.4.0/src/briefing/static/report.js +527 -0
  55. briefing-0.4.0/src/briefing/static/unpack.js +179 -0
  56. briefing-0.4.0/src/briefing/templates/fragment.html.j2 +8 -0
  57. {briefing-0.2.4 → briefing-0.4.0}/src/briefing/templates/report.html.j2 +3 -1
  58. {briefing-0.2.4 → briefing-0.4.0}/tests/compat_reports.py +2 -1
  59. {briefing-0.2.4 → briefing-0.4.0}/tests/conftest.py +22 -0
  60. {briefing-0.2.4 → briefing-0.4.0}/tests/contract.py +72 -1
  61. briefing-0.4.0/tests/golden.py +143 -0
  62. briefing-0.4.0/tests/scenarios.py +270 -0
  63. briefing-0.4.0/tests/snapshots/golden/alert.html +43 -0
  64. briefing-0.4.0/tests/snapshots/golden/attachment.html +46 -0
  65. briefing-0.4.0/tests/snapshots/golden/banner.html +47 -0
  66. briefing-0.4.0/tests/snapshots/golden/bignumber.html +45 -0
  67. briefing-0.4.0/tests/snapshots/golden/calendar-diverging.html +44 -0
  68. briefing-0.4.0/tests/snapshots/golden/calendar.html +44 -0
  69. briefing-0.4.0/tests/snapshots/golden/code.html +43 -0
  70. briefing-0.4.0/tests/snapshots/golden/copy-embed.html +651 -0
  71. briefing-0.4.0/tests/snapshots/golden/datadive-df_all_null.html +44 -0
  72. briefing-0.4.0/tests/snapshots/golden/datadive-df_constant.html +44 -0
  73. briefing-0.4.0/tests/snapshots/golden/datadive-df_empty.html +44 -0
  74. briefing-0.4.0/tests/snapshots/golden/datadive-df_mixed.html +44 -0
  75. briefing-0.4.0/tests/snapshots/golden/datadive-df_single_row.html +44 -0
  76. briefing-0.4.0/tests/snapshots/golden/datadive-infinite.html +44 -0
  77. briefing-0.4.0/tests/snapshots/golden/dataprofile-df_all_null.html +43 -0
  78. briefing-0.4.0/tests/snapshots/golden/dataprofile-df_constant.html +43 -0
  79. briefing-0.4.0/tests/snapshots/golden/dataprofile-df_empty.html +43 -0
  80. briefing-0.4.0/tests/snapshots/golden/dataprofile-df_mixed.html +43 -0
  81. briefing-0.4.0/tests/snapshots/golden/dataprofile-df_single_row.html +43 -0
  82. briefing-0.4.0/tests/snapshots/golden/dataprofile-infinite.html +43 -0
  83. briefing-0.4.0/tests/snapshots/golden/datatable-big.html +44 -0
  84. briefing-0.4.0/tests/snapshots/golden/datatable-df_all_null.html +43 -0
  85. briefing-0.4.0/tests/snapshots/golden/datatable-df_constant.html +43 -0
  86. briefing-0.4.0/tests/snapshots/golden/datatable-df_empty.html +43 -0
  87. briefing-0.4.0/tests/snapshots/golden/datatable-df_mixed.html +43 -0
  88. briefing-0.4.0/tests/snapshots/golden/datatable-df_single_row.html +43 -0
  89. briefing-0.4.0/tests/snapshots/golden/datatable-formats.html +43 -0
  90. briefing-0.4.0/tests/snapshots/golden/datatable-infinite.html +43 -0
  91. briefing-0.4.0/tests/snapshots/golden/everything.html +2277 -0
  92. briefing-0.4.0/tests/snapshots/golden/export-menu.html +46 -0
  93. briefing-0.4.0/tests/snapshots/golden/formula.html +43 -0
  94. briefing-0.4.0/tests/snapshots/golden/group-widths.html +46 -0
  95. briefing-0.4.0/tests/snapshots/golden/html.html +43 -0
  96. briefing-0.4.0/tests/snapshots/golden/image.html +44 -0
  97. briefing-0.4.0/tests/snapshots/golden/links.html +55 -0
  98. briefing-0.4.0/tests/snapshots/golden/nested-layout.html +51 -0
  99. briefing-0.4.0/tests/snapshots/golden/pages.html +45 -0
  100. briefing-0.4.0/tests/snapshots/golden/plot-altair.html +48 -0
  101. briefing-0.4.0/tests/snapshots/golden/plot-matplotlib.html +43 -0
  102. briefing-0.4.0/tests/snapshots/golden/plot-plotly.html +48 -0
  103. briefing-0.4.0/tests/snapshots/golden/select-dropdown.html +45 -0
  104. briefing-0.4.0/tests/snapshots/golden/select-tabs.html +45 -0
  105. briefing-0.4.0/tests/snapshots/golden/table-df_all_null.html +64 -0
  106. briefing-0.4.0/tests/snapshots/golden/table-df_constant.html +252 -0
  107. briefing-0.4.0/tests/snapshots/golden/table-df_empty.html +50 -0
  108. briefing-0.4.0/tests/snapshots/golden/table-df_mixed.html +2259 -0
  109. briefing-0.4.0/tests/snapshots/golden/table-df_single_row.html +58 -0
  110. briefing-0.4.0/tests/snapshots/golden/table-infinite.html +72 -0
  111. briefing-0.4.0/tests/snapshots/golden/table-styler.html +309 -0
  112. briefing-0.4.0/tests/snapshots/golden/text-markdown-table.html +57 -0
  113. briefing-0.4.0/tests/snapshots/golden/text.html +45 -0
  114. briefing-0.4.0/tests/snapshots/golden/time-heatmap-months.html +44 -0
  115. briefing-0.4.0/tests/snapshots/golden/time-heatmap.html +44 -0
  116. briefing-0.4.0/tests/snapshots/golden/toggle.html +46 -0
  117. briefing-0.4.0/tests/snapshots/golden/two-matplotlib-plots.html +44 -0
  118. briefing-0.4.0/tests/snapshots/golden/two-table-stylers.html +576 -0
  119. briefing-0.4.0/tests/strategies.py +64 -0
  120. {briefing-0.2.4 → briefing-0.4.0}/tests/test_blocks/test_banner.py +5 -2
  121. briefing-0.4.0/tests/test_blocks/test_files.py +69 -0
  122. {briefing-0.2.4 → briefing-0.4.0}/tests/test_blocks/test_layout.py +20 -0
  123. {briefing-0.2.4 → briefing-0.4.0}/tests/test_browser/conftest.py +16 -0
  124. briefing-0.4.0/tests/test_browser/test_big_tables.py +129 -0
  125. briefing-0.4.0/tests/test_browser/test_copy_embed.py +134 -0
  126. briefing-0.4.0/tests/test_browser/test_files.py +68 -0
  127. briefing-0.4.0/tests/test_browser/test_fragments.py +171 -0
  128. briefing-0.4.0/tests/test_browser/test_links.py +134 -0
  129. briefing-0.4.0/tests/test_browser/test_packed_runtimes.py +70 -0
  130. briefing-0.4.0/tests/test_browser/test_roots.py +157 -0
  131. briefing-0.4.0/tests/test_browser/test_table_cells.py +38 -0
  132. briefing-0.4.0/tests/test_browser/test_table_csv.py +96 -0
  133. {briefing-0.2.4 → briefing-0.4.0}/tests/test_browser/test_text.py +19 -1
  134. briefing-0.4.0/tests/test_browser/test_timeheatmap.py +57 -0
  135. briefing-0.4.0/tests/test_cli.py +211 -0
  136. {briefing-0.2.4 → briefing-0.4.0}/tests/test_compat.py +4 -1
  137. briefing-0.4.0/tests/test_contract.py +153 -0
  138. briefing-0.4.0/tests/test_copy_embed.py +123 -0
  139. briefing-0.4.0/tests/test_deprecations.py +92 -0
  140. {briefing-0.2.4 → briefing-0.4.0}/tests/test_docs_gallery.py +12 -6
  141. briefing-0.4.0/tests/test_fragments.py +195 -0
  142. briefing-0.4.0/tests/test_golden.py +79 -0
  143. briefing-0.4.0/tests/test_install.py +18 -0
  144. {briefing-0.2.4 → briefing-0.4.0}/tests/test_lab/test_profile.py +6 -0
  145. briefing-0.4.0/tests/test_lab/test_timeheatmap.py +123 -0
  146. {briefing-0.2.4 → briefing-0.4.0}/tests/test_no_viz_deps.py +6 -0
  147. briefing-0.4.0/tests/test_properties.py +83 -0
  148. briefing-0.4.0/tests/test_renderers/test_big_tables.py +97 -0
  149. briefing-0.4.0/tests/test_renderers/test_css_scope.py +65 -0
  150. {briefing-0.2.4 → briefing-0.4.0}/tests/test_renderers/test_export_menu.py +3 -23
  151. briefing-0.4.0/tests/test_renderers/test_files.py +72 -0
  152. briefing-0.4.0/tests/test_renderers/test_formatting.py +17 -0
  153. {briefing-0.2.4 → briefing-0.4.0}/tests/test_renderers/test_html.py +53 -1
  154. briefing-0.4.0/tests/test_renderers/test_links.py +106 -0
  155. briefing-0.4.0/tests/test_renderers/test_markup.py +70 -0
  156. {briefing-0.2.4 → briefing-0.4.0}/tests/test_renderers/test_plot.py +59 -4
  157. briefing-0.4.0/tests/test_renderers/test_registry.py +18 -0
  158. briefing-0.4.0/tests/test_renderers/test_size.py +153 -0
  159. briefing-0.4.0/tests/test_renderers/test_table_cells.py +141 -0
  160. briefing-0.4.0/tests/test_renderers/test_table_csv.py +39 -0
  161. briefing-0.4.0/tests/test_spec/__init__.py +0 -0
  162. briefing-0.4.0/tests/test_spec/test_from_spec.py +193 -0
  163. briefing-0.4.0/tests/test_spec/test_reference.py +114 -0
  164. briefing-0.4.0/tests/test_spec/test_round_trip.py +57 -0
  165. briefing-0.4.0/tests/test_spec/test_schema.py +55 -0
  166. briefing-0.4.0/tests/test_spec/test_spec_properties.py +150 -0
  167. briefing-0.4.0/tests/test_spec/test_to_spec.py +183 -0
  168. briefing-0.4.0/tests/test_spec/test_validate.py +275 -0
  169. briefing-0.4.0/tests/test_static_scripts.py +65 -0
  170. briefing-0.4.0/tests/test_version.py +28 -0
  171. briefing-0.2.4/src/briefing/__init__.py +0 -215
  172. briefing-0.2.4/src/briefing/_cli.py +0 -86
  173. briefing-0.2.4/src/briefing/renderers/registry.py +0 -102
  174. briefing-0.2.4/src/briefing/renderers/table.py +0 -206
  175. briefing-0.2.4/src/briefing/static/report.js +0 -257
  176. briefing-0.2.4/tests/test_cli.py +0 -97
  177. briefing-0.2.4/tests/test_contract.py +0 -331
  178. briefing-0.2.4/tests/test_deprecations.py +0 -120
  179. {briefing-0.2.4 → briefing-0.4.0}/LICENSE +0 -0
  180. {briefing-0.2.4 → briefing-0.4.0}/noxfile.py +0 -0
  181. {briefing-0.2.4 → briefing-0.4.0}/src/briefing/_error.py +0 -0
  182. {briefing-0.2.4 → briefing-0.4.0}/src/briefing/_frames.py +0 -0
  183. {briefing-0.2.4 → briefing-0.4.0}/src/briefing/_preview.py +0 -0
  184. {briefing-0.2.4 → briefing-0.4.0}/src/briefing/export/__init__.py +0 -0
  185. {briefing-0.2.4 → briefing-0.4.0}/src/briefing/export/_image.py +0 -0
  186. {briefing-0.2.4 → briefing-0.4.0}/src/briefing/export/_pdf.py +0 -0
  187. {briefing-0.2.4 → briefing-0.4.0}/src/briefing/lab/_render_datadive.py +0 -0
  188. {briefing-0.2.4 → briefing-0.4.0}/src/briefing/py.typed +0 -0
  189. {briefing-0.2.4 → briefing-0.4.0}/src/briefing/renderers/__init__.py +0 -0
  190. {briefing-0.2.4 → briefing-0.4.0}/src/briefing/renderers/formula.py +0 -0
  191. {briefing-0.2.4 → briefing-0.4.0}/src/briefing/renderers/normalize.py +0 -0
  192. {briefing-0.2.4 → briefing-0.4.0}/src/briefing/renderers/script_json.py +0 -0
  193. {briefing-0.2.4 → briefing-0.4.0}/src/briefing/static/export.css +0 -0
  194. {briefing-0.2.4 → briefing-0.4.0}/tests/__init__.py +0 -0
  195. {briefing-0.2.4 → briefing-0.4.0}/tests/banner_images.py +0 -0
  196. {briefing-0.2.4 → briefing-0.4.0}/tests/html_helpers.py +0 -0
  197. {briefing-0.2.4 → briefing-0.4.0}/tests/image_helpers.py +0 -0
  198. {briefing-0.2.4 → briefing-0.4.0}/tests/pdf_reader.py +0 -0
  199. {briefing-0.2.4 → briefing-0.4.0}/tests/snapshots/compat_0_1_2/blocks.body.html +0 -0
  200. {briefing-0.2.4 → briefing-0.4.0}/tests/snapshots/compat_0_1_2/pages.body.html +0 -0
  201. {briefing-0.2.4 → briefing-0.4.0}/tests/test_blocks/__init__.py +0 -0
  202. {briefing-0.2.4 → briefing-0.4.0}/tests/test_blocks/test_base.py +0 -0
  203. {briefing-0.2.4 → briefing-0.4.0}/tests/test_blocks/test_text.py +0 -0
  204. {briefing-0.2.4 → briefing-0.4.0}/tests/test_browser/__init__.py +0 -0
  205. {briefing-0.2.4 → briefing-0.4.0}/tests/test_browser/test_banner.py +0 -0
  206. {briefing-0.2.4 → briefing-0.4.0}/tests/test_browser/test_bignumber.py +0 -0
  207. {briefing-0.2.4 → briefing-0.4.0}/tests/test_browser/test_calendar.py +0 -0
  208. {briefing-0.2.4 → briefing-0.4.0}/tests/test_browser/test_cli_export.py +0 -0
  209. {briefing-0.2.4 → briefing-0.4.0}/tests/test_browser/test_code.py +0 -0
  210. {briefing-0.2.4 → briefing-0.4.0}/tests/test_browser/test_datadive.py +0 -0
  211. {briefing-0.2.4 → briefing-0.4.0}/tests/test_browser/test_datatable.py +0 -0
  212. {briefing-0.2.4 → briefing-0.4.0}/tests/test_browser/test_export_image.py +0 -0
  213. {briefing-0.2.4 → briefing-0.4.0}/tests/test_browser/test_export_menu.py +0 -0
  214. {briefing-0.2.4 → briefing-0.4.0}/tests/test_browser/test_export_pdf.py +0 -0
  215. {briefing-0.2.4 → briefing-0.4.0}/tests/test_browser/test_formula.py +0 -0
  216. {briefing-0.2.4 → briefing-0.4.0}/tests/test_browser/test_layout.py +0 -0
  217. {briefing-0.2.4 → briefing-0.4.0}/tests/test_browser/test_notebook.py +0 -0
  218. {briefing-0.2.4 → briefing-0.4.0}/tests/test_browser/test_plots.py +0 -0
  219. {briefing-0.2.4 → briefing-0.4.0}/tests/test_browser/test_print.py +0 -0
  220. {briefing-0.2.4 → briefing-0.4.0}/tests/test_browser/test_spacing.py +0 -0
  221. {briefing-0.2.4 → briefing-0.4.0}/tests/test_browser/test_toggle_theme.py +0 -0
  222. {briefing-0.2.4 → briefing-0.4.0}/tests/test_docstrings.py +0 -0
  223. {briefing-0.2.4 → briefing-0.4.0}/tests/test_export.py +0 -0
  224. {briefing-0.2.4 → briefing-0.4.0}/tests/test_frames.py +0 -0
  225. {briefing-0.2.4 → briefing-0.4.0}/tests/test_lab/__init__.py +0 -0
  226. {briefing-0.2.4 → briefing-0.4.0}/tests/test_lab/test_calendar.py +0 -0
  227. {briefing-0.2.4 → briefing-0.4.0}/tests/test_lab/test_datadive.py +0 -0
  228. {briefing-0.2.4 → briefing-0.4.0}/tests/test_lab/test_lab_boundary.py +0 -0
  229. {briefing-0.2.4 → briefing-0.4.0}/tests/test_pdf_reader.py +0 -0
  230. {briefing-0.2.4 → briefing-0.4.0}/tests/test_preview.py +0 -0
  231. {briefing-0.2.4 → briefing-0.4.0}/tests/test_readme.py +0 -0
  232. {briefing-0.2.4 → briefing-0.4.0}/tests/test_renderers/__init__.py +0 -0
  233. {briefing-0.2.4 → briefing-0.4.0}/tests/test_renderers/test_formula.py +0 -0
  234. {briefing-0.2.4 → briefing-0.4.0}/tests/test_renderers/test_normalize.py +0 -0
  235. {briefing-0.2.4 → briefing-0.4.0}/tests/test_renderers/test_reproducible.py +0 -0
  236. {briefing-0.2.4 → briefing-0.4.0}/tests/test_renderers/test_table.py +0 -0
@@ -17,6 +17,7 @@ env/
17
17
  .coverage.*
18
18
  htmlcov/
19
19
  coverage.xml
20
+ .hypothesis/
20
21
 
21
22
  # Tooling caches
22
23
  .mypy_cache/
@@ -10,6 +10,156 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
10
10
 
11
11
  ## [Unreleased]
12
12
 
13
+ ## [0.4.0] - 2026-11-20
14
+
15
+ ### Added
16
+
17
+ - A copy-embed button for readers (#124). `bf.Briefing(..., export="embed")` puts a `</>`
18
+ button on each page, labelled group, chart, table, text, number, alert, banner and lab
19
+ block: it copies that part as an embed fragment (as `bf.stringify(..., full_html=False)`
20
+ makes), CSS, scripts and chart runtime included, to paste into another page. What is
21
+ copied is the report as it was made, not as clicks left it: the report carries a
22
+ compressed copy of its untouched blocks. Where copying is refused, the code shows in a
23
+ dialog. The buttons never print or export. A report without `"embed"` is unchanged.
24
+ - Reports as JSON (#31). `bf.to_spec(report)` gives a report's JSON form (each block as
25
+ `{"type": "Text", ...}` with the constructor's parameters as keys) and the dataframes and
26
+ figures it names by reference; `bf.from_spec(spec, data)` builds the report back, byte for
27
+ byte the same. With `to_spec(..., inline=True)`, tables, Plotly and Altair charts and
28
+ images go into the JSON when they come back exactly the same. `bf.validate(spec, data)`
29
+ (or `bf.validate(report)`) returns every problem as a `bf.Diagnostic` with a code, a JSON
30
+ Pointer to where it is, a message and a hint, and never raises: unknown types and
31
+ options, wrong types, unknown references, duplicate names, empty containers, a block's
32
+ own checks and warnings, and whatever stops the report from rendering. `bf.schema()`
33
+ returns the format's JSON Schema, which also ships as `briefing/schema/v1.json`. A
34
+ `Select`'s `type` is written `"select_type"` in JSON, since `"type"` names the block.
35
+ - A reference for agents, shipped with the package (#32). `python -m briefing reference`
36
+ prints it: how to write, check and render a report's JSON, every block and option with
37
+ its type, default and description, the diagnostic codes and a complete example. It is
38
+ generated from the block classes, so it matches the installed version. The command line
39
+ gains `validate` (exit status 1 on an error, `--json` for a JSON list) and `render` for
40
+ report JSON, both taking referenced tables as `--data name=file.csv` (or `.parquet`), and
41
+ `skill --install`, which writes a Claude Code skill pointing to the reference into
42
+ `.claude/skills/briefing/`. The docs publish the reference as `llms-full.txt`, with an
43
+ `llms.txt` index.
44
+ - A size budget (#38). `bf.save` and `bf.stringify` warn when a report is bigger than
45
+ `max_size`, 10 MB by default, and name its largest parts with their place in the
46
+ report: `DataTable "orders" at /blocks/2 (9.1 MB), the Plotly runtime (2.0 MB)`. Chart
47
+ runtimes and the copy-embed data count. `max_size="25 MB"` or a number of bytes changes
48
+ it, `None` turns it off. `bf.validate` and `python -m briefing validate --max-size`
49
+ report it as a `too-big` warning.
50
+ - Big tables weigh less (#38). A `DataTable` of more than 1,000 rows keeps its first page
51
+ in the HTML and its rows compressed, unpacked by the page's script as the report opens:
52
+ 10,000 rows × 10 columns of decimals go from 5.0 MB to 1.8 MB, of whole numbers from
53
+ 1.3 MB to 0.3 MB. It sorts, searches, pages and prints as before; without JavaScript it
54
+ shows its first 25 rows and says how many more there are. Up to 1,000 rows, nothing
55
+ changes.
56
+ - Chart runtimes are compressed (#38). Plotly's and Vega's runtimes are stored deflated
57
+ and unpacked by the report as it opens, before any chart draws, with no network and no
58
+ newer browser feature: a report with one Plotly chart goes from 4.9 MB to 2.0 MB, one
59
+ with an Altair chart from 0.9 MB to 0.5 MB. Fragments, `embed_assets` and copy-embed
60
+ copies carry them the same way, and charts look and behave as before.
61
+ - Number formats and links in `DataTable` cells (#33). `formats={"revenue": "€ {:,.0f}",
62
+ "share": "{:.1%}", "day": "{:%d %b %Y}"}` shows a column with a Python format string or a
63
+ function, while cells still sort by their value. `links={"doi": "https://doi.org/{}",
64
+ "title": "{url}"}` makes a column's cells links, from the cell's value or another column
65
+ of the row; only `http(s)://` and `mailto:` URLs become links (the rest stays text, with
66
+ a warning), and they open in a new tab. Big tables pack the formatted text and the links.
67
+ - A CSV download for `DataTable` (#34). `download=True` puts a "CSV" button above the table:
68
+ it downloads the rows matching the reader's search, in their order, every page, with raw
69
+ values rather than the formatted text, as UTF-8 with a byte-order mark; formula-like text
70
+ is escaped. Off by default; it never prints or appears in exports.
71
+ - `Image` and `Attachment` blocks (#36). `bf.Image(path_or_bytes, caption=, alt=, width=)`
72
+ embeds a PNG, JPEG, GIF, WebP or SVG as a data URI, at its natural size or `width`,
73
+ described by `alt` or its caption. `bf.Attachment(path)`, `bf.Attachment(data,
74
+ filename=)` or `bf.Attachment(dataframe, filename="orders.csv")` puts a file in the report
75
+ for readers to download, with no server: any file type, text files stored compressed, a
76
+ dataframe as the same CSV as a `DataTable`'s button. Both have a JSON form, a copy-embed
77
+ button, and count towards the size budget.
78
+ - `lab.TimeHeatmap`, for time patterns (#111). `bf.lab.TimeHeatmap(df, date=, rows="weekday",
79
+ columns="hour")` crosses two units of one date column (`hour`, `weekday`, `day`, `week`,
80
+ `month`, `quarter`, `year`): when runs happen, seasonality, month-end effects, year over
81
+ year. Counts and sums are averaged per occurrence of their cell, so a weekday that
82
+ appears more often doesn't count double; cells that can't exist (31 February) are left
83
+ blank. It shares the calendar's options, legend, tooltip, width fitting and
84
+ `on_click="rows"`.
85
+
86
+ ### Changed
87
+
88
+ - pandas is a core dependency (#40): `Table`, `DataTable`, the lab blocks and tables written
89
+ in JSON need it, even for polars data. `import briefing` still imports it only when a
90
+ table needs it. A chart from a library older than briefing supports (Plotly 5, Altair 5,
91
+ Matplotlib 3.7, Bokeh 3) shows which version it needs in place of the chart.
92
+
93
+ - `Banner` no longer warns about images over 2 MB on its own: the size budget names a
94
+ heavy image when the report is over it (#38). `Banner.MAX_IMAGE_BYTES` is gone.
95
+
96
+ ### Deprecated
97
+
98
+ - `CalendarHeatmap`'s hour view (`views=("hours",)`), deprecated since 0.2.2, now has its
99
+ replacement, `lab.TimeHeatmap(rows="weekday", columns="hour")`, and goes in 0.5.0 (#111).
100
+
101
+ ### Removed
102
+
103
+ - The extras that added nothing (#40): `[pandas]` (pandas is in the core), `[plotly]`, `[bokeh]`,
104
+ `[matplotlib]` and `[charts]` (`Plot` uses the library you already have), and `[email]`
105
+ (there is no email feature yet; it comes back with it). An old `pip install
106
+ "briefing[plotly]"` still installs briefing, with a warning from pip. `[altair]`, `[lab]`,
107
+ `[image]`, `[docs]` and `[dev]` stay.
108
+
109
+ - `Briefing(export="pdf")`, deprecated since 0.2.4, now raises an error that says what to use
110
+ instead: Ctrl+P (or ⌘P) to print, with the same print layout, or `bf.save_pdf` for a file.
111
+
112
+ ## [0.3.0] - 2026-11-20
113
+
114
+ ### Added
115
+
116
+ - Every report says which version of briefing made it: a footer line, "Made with briefing
117
+ 0.3.0", and `<meta name="generator">` in the page head. `Briefing(footer="Analytics team")`
118
+ puts text before that line; the line itself can't be turned off (#23).
119
+ - Fragments to embed in other pages, like Plotly's `full_html=False` (#122).
120
+ `bf.stringify(chart, full_html=False)` (and `bf.save(..., full_html=False)`) gives one
121
+ `<div class="bf-embed">` that carries its theme, scopes every CSS rule to itself, starts
122
+ every id with its `embed_id` and initialises only its own scripts, so several fragments,
123
+ dark and light, share a page. `include_assets=False` with `bf.embed_assets(blocks)` sends
124
+ the CSS, scripts and chart runtimes once. A host's rules for plain elements and a changed
125
+ root font size don't reach the fragment. New guide: "Embed in other pages".
126
+ - Links to pages, tabs and headings (#24). A block's `name=` is now its link:
127
+ `report.html#detail` opens the page named `detail`, `#detail/by-region` a tab or block
128
+ named `by-region` in it, and `## Methodology {#methodology}` names a heading
129
+ (`#detail/methodology`). Opening a link selects its page and tab, opens any toggle around it
130
+ and scrolls to it, also offline. Choosing a tab puts its link in the address bar without a
131
+ history entry, so a reload keeps it open. Named headings show a copy-link icon on hover. A
132
+ name used twice in one page raises an error.
133
+ - `Formatting.to_css_vars(selector=":root")` takes the selector to put the theme on, so a
134
+ theme can apply to one element instead of the whole page (#123).
135
+
136
+ ### Changed
137
+
138
+ - The report's scripts now work inside the root they are given instead of on the whole page:
139
+ `window.briefing.init(root)` wires up tabs, toggles, tables, calendars and the export menu
140
+ in that root, once. A full report calls `briefing.init(document)`, so it behaves as before;
141
+ this lets two briefing outputs share a page later (#123).
142
+
143
+ ### Removed
144
+
145
+ - The names deprecated in 0.2 are gone, as their warnings announced: `bf.Blocks`,
146
+ `bf.BaseBlock`, `bf.save_report` and `bf.stringify_report` (use `bf.Briefing`, `bf.Block`,
147
+ `bf.save` and `bf.stringify`), and `bf.DataProfile` / `bf.DataDive` at the top level (use
148
+ `bf.lab.DataProfile` / `bf.lab.DataDive`). Each old name now raises an `AttributeError` that
149
+ says what to use instead. `Plot(scale=...)`, which had no effect, is removed too: size the
150
+ figure in its plotting library.
151
+
152
+ ### Fixed
153
+
154
+ - A `Text` or `HTML` block that leaves a comment, a tag or a `<script>`, `<style>` or
155
+ `<textarea>` open, such as a line starting with `<!-- draft note`, no longer hides
156
+ everything after it: the later blocks, the footer and the report's script, so tabs stopped
157
+ working. briefing closes what is left open at the end of the block. Found by the new
158
+ property tests (#45).
159
+ - `bf.lab.DataProfile` no longer fails with "cannot convert float NaN to integer" on a
160
+ numeric column whose values span more than the largest float, such as -1e308 and 1e308.
161
+ The new property tests found it (#45).
162
+
13
163
  ## [0.2.4] - 2026-11-17
14
164
 
15
165
  ### Fixed
@@ -265,7 +415,9 @@ First public release.
265
415
  inherits its base's renderer.
266
416
  - Ships inline type hints (`py.typed`). Python 3.11+.
267
417
 
268
- [Unreleased]: https://github.com/jeanmidevacc/briefing/compare/v0.2.4...HEAD
418
+ [Unreleased]: https://github.com/jeanmidevacc/briefing/compare/v0.4.0...HEAD
419
+ [0.4.0]: https://github.com/jeanmidevacc/briefing/compare/v0.3.0...v0.4.0
420
+ [0.3.0]: https://github.com/jeanmidevacc/briefing/compare/v0.2.4...v0.3.0
269
421
  [0.2.4]: https://github.com/jeanmidevacc/briefing/compare/v0.2.3...v0.2.4
270
422
  [0.2.3]: https://github.com/jeanmidevacc/briefing/compare/v0.2.2...v0.2.3
271
423
  [0.2.2]: https://github.com/jeanmidevacc/briefing/compare/v0.2.1...v0.2.2
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: briefing
3
- Version: 0.2.4
3
+ Version: 0.4.0
4
4
  Summary: Build beautiful self-contained HTML reports from Python analysis
5
5
  Project-URL: Homepage, https://github.com/jeanmidevacc/briefing
6
6
  Project-URL: Documentation, https://briefing.readthedocs.io
@@ -23,18 +23,11 @@ Requires-Python: >=3.11
23
23
  Requires-Dist: jinja2>=3.1
24
24
  Requires-Dist: latex2mathml>=3.77
25
25
  Requires-Dist: markdown-it-py>=3.0
26
+ Requires-Dist: pandas>=2.0
26
27
  Requires-Dist: pygments>=2.15
27
28
  Provides-Extra: altair
28
29
  Requires-Dist: altair>=5.0; extra == 'altair'
29
30
  Requires-Dist: vl-convert-python>=1.0; extra == 'altair'
30
- Provides-Extra: bokeh
31
- Requires-Dist: bokeh>=3.0; extra == 'bokeh'
32
- Provides-Extra: charts
33
- Requires-Dist: altair>=5.0; extra == 'charts'
34
- Requires-Dist: bokeh>=3.0; extra == 'charts'
35
- Requires-Dist: matplotlib>=3.7; extra == 'charts'
36
- Requires-Dist: plotly>=5.0; extra == 'charts'
37
- Requires-Dist: vl-convert-python>=1.0; extra == 'charts'
38
31
  Provides-Extra: dev
39
32
  Requires-Dist: altair>=5.0; extra == 'dev'
40
33
  Requires-Dist: beautifulsoup4>=4.14; extra == 'dev'
@@ -59,19 +52,9 @@ Requires-Dist: myst-parser>=2.0; extra == 'docs'
59
52
  Requires-Dist: pandas>=2.0; extra == 'docs'
60
53
  Requires-Dist: plotly>=5.0; extra == 'docs'
61
54
  Requires-Dist: sphinx>=7.0; extra == 'docs'
62
- Provides-Extra: email
63
- Requires-Dist: kaleido>=0.2; extra == 'email'
64
- Requires-Dist: premailer>=3.10; extra == 'email'
65
55
  Provides-Extra: image
66
56
  Requires-Dist: playwright>=1.40; extra == 'image'
67
57
  Provides-Extra: lab
68
- Requires-Dist: pandas>=2.0; extra == 'lab'
69
- Provides-Extra: matplotlib
70
- Requires-Dist: matplotlib>=3.7; extra == 'matplotlib'
71
- Provides-Extra: pandas
72
- Requires-Dist: pandas>=2.0; extra == 'pandas'
73
- Provides-Extra: plotly
74
- Requires-Dist: plotly>=5.0; extra == 'plotly'
75
58
  Description-Content-Type: text/markdown
76
59
 
77
60
  # briefing
@@ -100,16 +83,14 @@ briefing is built to close all three gaps at once: a block grammar solid enough
100
83
  ## Install
101
84
 
102
85
  ```bash
103
- pip install briefing # the block grammar and the HTML renderer
104
- pip install "briefing[pandas]" # tables from dataframes
105
- pip install "briefing[lab]" # DataProfile, DataDive, CalendarHeatmap
86
+ pip install briefing # every block (lab included), HTML reports, tables
87
+ pip install "briefing[altair]" # for Altair charts: the Vega runtime they embed
106
88
  pip install "briefing[image]" # save_image / save_pdf (then: playwright install chromium)
107
89
  ```
108
90
 
109
- The core has no plotting or dataframe dependency. `Plot` takes a Plotly, Altair, Matplotlib or
110
- Bokeh figure and imports only the library you pass; install `[plotly]`, `[altair]`, `[bokeh]`,
111
- `[matplotlib]` or all of them with `[charts]`. Python 3.11+, pandas 2 and 3; polars and pyarrow
112
- tables are converted for you.
91
+ briefing installs pandas, for tables, but no chart library: `Plot` takes a Plotly, Altair,
92
+ Matplotlib or Bokeh figure and imports only the library you pass, which you already have.
93
+ Python 3.11+, pandas 2 and 3; polars and pyarrow tables are converted for you.
113
94
 
114
95
  ## Quick start
115
96
 
@@ -139,11 +120,22 @@ previews itself as the last expression of a cell.
139
120
  With `briefing[image]`, `bf.save_image(report, "q1.png", size="og")` renders a 1200×630 social
140
121
  card and `bf.save_pdf(report, "q1.pdf")` a PDF of every page, both offline in headless Chromium.
141
122
 
123
+ To put a chart, a table or a whole report into another page (a docs site, a notebook, a wiki),
124
+ `bf.stringify(report, full_html=False)` gives one self-contained `<div>`, like Plotly's
125
+ `to_html(full_html=False)`: it keeps its look and interactivity, and several share a page.
126
+
127
+ A report can also be written as JSON, by a coding agent or any other program:
128
+ `bf.validate(spec)` lists what is wrong in it, each problem with its place, and
129
+ `bf.from_spec(spec, data={"sales": df})` builds the report. `bf.to_spec(report)` gives the
130
+ JSON of a report written in Python, and `bf.schema()` the format's JSON Schema. For agents,
131
+ `python -m briefing reference` prints the format and every block's options at the installed
132
+ version, and `python -m briefing validate report.json` checks a report without Python code.
133
+
142
134
  ## Documentation
143
135
 
144
136
  **[briefing.readthedocs.io](https://briefing.readthedocs.io)** has a guide for each block family
145
- with live examples, themes, notebooks, printing and export, the `briefing.lab` blocks, recipes and
146
- the full API reference.
137
+ with live examples, themes, notebooks, printing and export, embedding in other pages, reports as JSON, the
138
+ `briefing.lab` blocks, recipes and the full API reference.
147
139
 
148
140
  - [Changelog](CHANGELOG.md)
149
141
  - [`examples/notebook_walkthrough.ipynb`](examples/notebook_walkthrough.ipynb): build a report
@@ -24,16 +24,14 @@ briefing is built to close all three gaps at once: a block grammar solid enough
24
24
  ## Install
25
25
 
26
26
  ```bash
27
- pip install briefing # the block grammar and the HTML renderer
28
- pip install "briefing[pandas]" # tables from dataframes
29
- pip install "briefing[lab]" # DataProfile, DataDive, CalendarHeatmap
27
+ pip install briefing # every block (lab included), HTML reports, tables
28
+ pip install "briefing[altair]" # for Altair charts: the Vega runtime they embed
30
29
  pip install "briefing[image]" # save_image / save_pdf (then: playwright install chromium)
31
30
  ```
32
31
 
33
- The core has no plotting or dataframe dependency. `Plot` takes a Plotly, Altair, Matplotlib or
34
- Bokeh figure and imports only the library you pass; install `[plotly]`, `[altair]`, `[bokeh]`,
35
- `[matplotlib]` or all of them with `[charts]`. Python 3.11+, pandas 2 and 3; polars and pyarrow
36
- tables are converted for you.
32
+ briefing installs pandas, for tables, but no chart library: `Plot` takes a Plotly, Altair,
33
+ Matplotlib or Bokeh figure and imports only the library you pass, which you already have.
34
+ Python 3.11+, pandas 2 and 3; polars and pyarrow tables are converted for you.
37
35
 
38
36
  ## Quick start
39
37
 
@@ -63,11 +61,22 @@ previews itself as the last expression of a cell.
63
61
  With `briefing[image]`, `bf.save_image(report, "q1.png", size="og")` renders a 1200×630 social
64
62
  card and `bf.save_pdf(report, "q1.pdf")` a PDF of every page, both offline in headless Chromium.
65
63
 
64
+ To put a chart, a table or a whole report into another page (a docs site, a notebook, a wiki),
65
+ `bf.stringify(report, full_html=False)` gives one self-contained `<div>`, like Plotly's
66
+ `to_html(full_html=False)`: it keeps its look and interactivity, and several share a page.
67
+
68
+ A report can also be written as JSON, by a coding agent or any other program:
69
+ `bf.validate(spec)` lists what is wrong in it, each problem with its place, and
70
+ `bf.from_spec(spec, data={"sales": df})` builds the report. `bf.to_spec(report)` gives the
71
+ JSON of a report written in Python, and `bf.schema()` the format's JSON Schema. For agents,
72
+ `python -m briefing reference` prints the format and every block's options at the installed
73
+ version, and `python -m briefing validate report.json` checks a report without Python code.
74
+
66
75
  ## Documentation
67
76
 
68
77
  **[briefing.readthedocs.io](https://briefing.readthedocs.io)** has a guide for each block family
69
- with live examples, themes, notebooks, printing and export, the `briefing.lab` blocks, recipes and
70
- the full API reference.
78
+ with live examples, themes, notebooks, printing and export, embedding in other pages, reports as JSON, the
79
+ `briefing.lab` blocks, recipes and the full API reference.
71
80
 
72
81
  - [Changelog](CHANGELOG.md)
73
82
  - [`examples/notebook_walkthrough.ipynb`](examples/notebook_walkthrough.ipynb): build a report
@@ -5,7 +5,7 @@ requires = ["hatchling>=1.21,<1.27"]
5
5
  build-backend = "hatchling.build"
6
6
 
7
7
  [tool.hatch.version]
8
- path = "src/briefing/__init__.py"
8
+ path = "src/briefing/_version.py"
9
9
 
10
10
  [tool.hatch.build.targets.wheel]
11
11
  packages = ["src/briefing"]
@@ -58,6 +58,8 @@ dependencies = [
58
58
  "pygments>=2.15",
59
59
  # Formula: LaTeX → MathML at render time (pure Python, MIT, no dependencies)
60
60
  "latex2mathml>=3.77",
61
+ # Table, DataTable, the lab blocks and tables written in JSON (#40); imported only when used
62
+ "pandas>=2.0",
61
63
  ]
62
64
 
63
65
  [project.urls]
@@ -68,21 +70,13 @@ Issues = "https://github.com/jeanmidevacc/briefing/issues"
68
70
  Changelog = "https://github.com/jeanmidevacc/briefing/blob/main/CHANGELOG.md"
69
71
 
70
72
  [project.optional-dependencies]
71
- # pip install briefing[pandas] — internal engine for Table / DataTable
72
- pandas = ["pandas>=2.0"]
73
- # pip install briefing[lab] — briefing.lab custom-visualisation blocks
74
- # (DataProfile, DataDive). Pure-SVG today; grows here so the core grammar
75
- # stays small.
76
- lab = ["pandas>=2.0"]
77
- # The `Plot` block is a bring-your-own-figure escape hatch. Install the plotting
78
- # library you actually use; briefing never imports one unless you pass its figure.
79
- plotly = ["plotly>=5.0"]
80
- # vl-convert-python supplies the Vega runtime that briefing embeds, so charts work offline
73
+ # The `Plot` block is a bring-your-own-figure escape hatch: it renders the figure you pass, from
74
+ # the library you already have, and checks that library's version (#40). Only Altair needs more:
75
+ # vl-convert-python supplies the Vega runtime that briefing embeds, so charts work offline.
81
76
  altair = ["altair>=5.0", "vl-convert-python>=1.0"]
82
- bokeh = ["bokeh>=3.0"]
83
- matplotlib = ["matplotlib>=3.7"]
84
- # pip install briefing[charts] — every supported Plot backend at once
85
- charts = ["plotly>=5.0", "altair>=5.0", "vl-convert-python>=1.0", "bokeh>=3.0", "matplotlib>=3.7"]
77
+ # pip install briefing[lab] — briefing.lab (DataProfile, DataDive, CalendarHeatmap) needs nothing
78
+ # beyond the core today; the extra stays so existing installs work and lab can grow here.
79
+ lab = []
86
80
  # pip install briefing[image] — bf.save_image / bf.save_pdf in headless Chromium;
87
81
  # run `playwright install chromium` once after installing
88
82
  image = ["playwright>=1.40"]
@@ -96,11 +90,6 @@ docs = [
96
90
  "matplotlib>=3.7",
97
91
  "plotly>=5.0",
98
92
  ]
99
- # pip install briefing[email]
100
- email = [
101
- "premailer>=3.10",
102
- "kaleido>=0.2",
103
- ]
104
93
  # pip install briefing[dev]
105
94
  dev = [
106
95
  "pytest>=8.0",