typ-tables 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 (232) hide show
  1. typ_tables-0.1.0/LICENSE +21 -0
  2. typ_tables-0.1.0/PKG-INFO +108 -0
  3. typ_tables-0.1.0/README.md +89 -0
  4. typ_tables-0.1.0/pyproject.toml +129 -0
  5. typ_tables-0.1.0/src/typ_tables/__init__.py +1025 -0
  6. typ_tables-0.1.0/src/typ_tables/_boxhead.py +94 -0
  7. typ_tables-0.1.0/src/typ_tables/_constants.py +3 -0
  8. typ_tables-0.1.0/src/typ_tables/_escape.py +47 -0
  9. typ_tables-0.1.0/src/typ_tables/_formats/__init__.py +769 -0
  10. typ_tables-0.1.0/src/typ_tables/_formats/_datetime.py +49 -0
  11. typ_tables-0.1.0/src/typ_tables/_formats/_numeric.py +366 -0
  12. typ_tables-0.1.0/src/typ_tables/_gutter.py +42 -0
  13. typ_tables-0.1.0/src/typ_tables/_locale.py +39 -0
  14. typ_tables-0.1.0/src/typ_tables/_location.py +65 -0
  15. typ_tables-0.1.0/src/typ_tables/_locators.py +410 -0
  16. typ_tables-0.1.0/src/typ_tables/_stub.py +143 -0
  17. typ_tables-0.1.0/src/typ_tables/_style.py +525 -0
  18. typ_tables-0.1.0/src/typ_tables/_typ_data.py +366 -0
  19. typ_tables-0.1.0/src/typ_tables/data/x_currencies.csv +173 -0
  20. typ_tables-0.1.0/src/typ_tables/locators.py +21 -0
  21. typ_tables-0.1.0/src/typ_tables/style.py +27 -0
  22. typ_tables-0.1.0/src/typ_tables/ttypes.py +76 -0
  23. typ_tables-0.1.0/tests/__init__.py +0 -0
  24. typ_tables-0.1.0/tests/__inline_snapshot__/test_adding_elements/TestTabFigure.test_string_caption/15718cad-d93d-4cbe-b576-728b5db06a15.typ +86 -0
  25. typ_tables-0.1.0/tests/__inline_snapshot__/test_adding_elements/TestTabFigure.test_typst_caption/f1f82a2a-2cbf-4e59-95d2-8599f7b323ed.typ +86 -0
  26. typ_tables-0.1.0/tests/__inline_snapshot__/test_adding_elements/TestTabHeader.test_string_title/b93906cf-393c-4e3e-b988-4d5c77de27b2.typ +92 -0
  27. typ_tables-0.1.0/tests/__inline_snapshot__/test_adding_elements/TestTabHeader.test_string_title_and_subtitle/a5494390-6b07-4388-8123-18ac44b5356b.typ +93 -0
  28. typ_tables-0.1.0/tests/__inline_snapshot__/test_adding_elements/TestTabHeader.test_typst_title/2f92128f-4518-476e-a234-a3dc1c1f4c82.typ +92 -0
  29. typ_tables-0.1.0/tests/__inline_snapshot__/test_date_time/__module__/date-pattern.typ +37 -0
  30. typ_tables-0.1.0/tests/__inline_snapshot__/test_date_time/__module__/datetime-pattern.typ +37 -0
  31. typ_tables-0.1.0/tests/__inline_snapshot__/test_date_time/__module__/day-month-year.typ +37 -0
  32. typ_tables-0.1.0/tests/__inline_snapshot__/test_date_time/__module__/day-only.typ +37 -0
  33. typ_tables-0.1.0/tests/__inline_snapshot__/test_date_time/__module__/default-date.typ +37 -0
  34. typ_tables-0.1.0/tests/__inline_snapshot__/test_date_time/__module__/default-datetime.typ +37 -0
  35. typ_tables-0.1.0/tests/__inline_snapshot__/test_date_time/__module__/default-time.typ +37 -0
  36. typ_tables-0.1.0/tests/__inline_snapshot__/test_date_time/__module__/dmy-hp.typ +37 -0
  37. typ_tables-0.1.0/tests/__inline_snapshot__/test_date_time/__module__/h-m-p-time.typ +37 -0
  38. typ_tables-0.1.0/tests/__inline_snapshot__/test_date_time/__module__/h-m-s-p-time.typ +37 -0
  39. typ_tables-0.1.0/tests/__inline_snapshot__/test_date_time/__module__/h-p-time.typ +37 -0
  40. typ_tables-0.1.0/tests/__inline_snapshot__/test_date_time/__module__/iso-short-time.typ +37 -0
  41. typ_tables-0.1.0/tests/__inline_snapshot__/test_date_time/__module__/just-top-row-date.typ +37 -0
  42. typ_tables-0.1.0/tests/__inline_snapshot__/test_date_time/__module__/just-top-row-datetime.typ +37 -0
  43. typ_tables-0.1.0/tests/__inline_snapshot__/test_date_time/__module__/just-top-row-time.typ +37 -0
  44. typ_tables-0.1.0/tests/__inline_snapshot__/test_date_time/__module__/mdy-hmsp.typ +37 -0
  45. typ_tables-0.1.0/tests/__inline_snapshot__/test_date_time/__module__/month-day-year.typ +37 -0
  46. typ_tables-0.1.0/tests/__inline_snapshot__/test_date_time/__module__/month-only.typ +37 -0
  47. typ_tables-0.1.0/tests/__inline_snapshot__/test_date_time/__module__/sep-dash.typ +37 -0
  48. typ_tables-0.1.0/tests/__inline_snapshot__/test_date_time/__module__/sep-t.typ +37 -0
  49. typ_tables-0.1.0/tests/__inline_snapshot__/test_date_time/__module__/time-pattern.typ +37 -0
  50. typ_tables-0.1.0/tests/__inline_snapshot__/test_date_time/__module__/wd-m-day-year.typ +37 -0
  51. typ_tables-0.1.0/tests/__inline_snapshot__/test_date_time/__module__/wdmdy-hmp.typ +37 -0
  52. typ_tables-0.1.0/tests/__inline_snapshot__/test_date_time/__module__/y-mn-day.typ +37 -0
  53. typ_tables-0.1.0/tests/__inline_snapshot__/test_date_time/__module__/year-iso.typ +37 -0
  54. typ_tables-0.1.0/tests/__inline_snapshot__/test_date_time/__module__/year-mn-day.typ +37 -0
  55. typ_tables-0.1.0/tests/__inline_snapshot__/test_date_time/__module__/year-only.typ +37 -0
  56. typ_tables-0.1.0/tests/__inline_snapshot__/test_date_time/__module__/year-quarter.typ +37 -0
  57. typ_tables-0.1.0/tests/__inline_snapshot__/test_date_time/__module__/year-week.typ +37 -0
  58. typ_tables-0.1.0/tests/__inline_snapshot__/test_date_time/test_date_from_string/date-from-string.typ +37 -0
  59. typ_tables-0.1.0/tests/__inline_snapshot__/test_date_time/test_datetime_from_string/datetime-from-string.typ +37 -0
  60. typ_tables-0.1.0/tests/__inline_snapshot__/test_date_time/test_datetime_with_format_str/datetime-format-str.typ +37 -0
  61. typ_tables-0.1.0/tests/__inline_snapshot__/test_date_time/test_time_from_string/time-from-string.typ +37 -0
  62. typ_tables-0.1.0/tests/__inline_snapshot__/test_fmt_tf/__module__/arrows-style.typ +60 -0
  63. typ_tables-0.1.0/tests/__inline_snapshot__/test_fmt_tf/__module__/check-mark-style.typ +60 -0
  64. typ_tables-0.1.0/tests/__inline_snapshot__/test_fmt_tf/__module__/circles-style.typ +60 -0
  65. typ_tables-0.1.0/tests/__inline_snapshot__/test_fmt_tf/__module__/custom-all-values.typ +60 -0
  66. typ_tables-0.1.0/tests/__inline_snapshot__/test_fmt_tf/__module__/custom-values.typ +60 -0
  67. typ_tables-0.1.0/tests/__inline_snapshot__/test_fmt_tf/__module__/default-tf.typ +60 -0
  68. typ_tables-0.1.0/tests/__inline_snapshot__/test_fmt_tf/__module__/diamonds-style.typ +60 -0
  69. typ_tables-0.1.0/tests/__inline_snapshot__/test_fmt_tf/__module__/just-top-row-tf.typ +60 -0
  70. typ_tables-0.1.0/tests/__inline_snapshot__/test_fmt_tf/__module__/na-value.typ +60 -0
  71. typ_tables-0.1.0/tests/__inline_snapshot__/test_fmt_tf/__module__/pattern-tf.typ +60 -0
  72. typ_tables-0.1.0/tests/__inline_snapshot__/test_fmt_tf/__module__/squares-style.typ +60 -0
  73. typ_tables-0.1.0/tests/__inline_snapshot__/test_fmt_tf/__module__/triangles-lr-style.typ +60 -0
  74. typ_tables-0.1.0/tests/__inline_snapshot__/test_fmt_tf/__module__/triangles-style.typ +60 -0
  75. typ_tables-0.1.0/tests/__inline_snapshot__/test_fmt_tf/__module__/up-down-style.typ +60 -0
  76. typ_tables-0.1.0/tests/__inline_snapshot__/test_fmt_tf/__module__/yes-no-style.typ +60 -0
  77. typ_tables-0.1.0/tests/__inline_snapshot__/test_fmt_tf/test_fmt_tf_all_boolean_columns/all-boolean-columns-tf.typ +57 -0
  78. typ_tables-0.1.0/tests/__inline_snapshot__/test_fmt_tf/test_fmt_tf_chaining/chaining-tf.typ +51 -0
  79. typ_tables-0.1.0/tests/__inline_snapshot__/test_fmt_tf/test_fmt_tf_multiple_columns/multiple-columns-tf.typ +57 -0
  80. typ_tables-0.1.0/tests/__inline_snapshot__/test_fmt_tf/test_fmt_tf_none_without_na_val/none-without-na-val.typ +27 -0
  81. typ_tables-0.1.0/tests/__inline_snapshot__/test_fmt_tf/test_fmt_tf_override_false_only/override-false-only.typ +27 -0
  82. typ_tables-0.1.0/tests/__inline_snapshot__/test_fmt_tf/test_fmt_tf_override_true_only/override-true-only.typ +27 -0
  83. typ_tables-0.1.0/tests/__inline_snapshot__/test_fmt_tf/test_fmt_tf_pattern_with_na_val/pattern-with-na-val.typ +27 -0
  84. typ_tables-0.1.0/tests/__inline_snapshot__/test_fmt_tf/test_fmt_tf_with_rowname_col/rowname-col-tf.typ +67 -0
  85. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/TestFString.test_add_text/38194acd-2a5c-49dc-950b-86b6defddd49.typ +51 -0
  86. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/TestFString.test_add_text_twice/ca688b19-cd8a-442a-9fcc-94b32eff3b79.typ +51 -0
  87. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/TestSubMissing.test_to_typst_format_float_with_missing/4e42ced7-d53a-44bc-b9e2-266b334abed2.typ +83 -0
  88. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/TestSubMissing.test_to_typst_format_float_with_missing/f7450830-7a1b-440f-bc59-221a534372a5.typ +83 -0
  89. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/TestSubMissing.test_to_typst_missing_two_variants/6ca1530f-c719-4a20-becf-0fb230fe14ec.typ +83 -0
  90. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/TestSubMissing.test_to_typst_string_int_float_with_missing/e8d0edad-ae47-441a-940a-82555cbed295.typ +83 -0
  91. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/accounting-floats-currency.typ +87 -0
  92. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/accounting-floats-perc.typ +87 -0
  93. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/accounting-floats.typ +150 -0
  94. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/accounting-int.typ +150 -0
  95. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/binary-standard.typ +82 -0
  96. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/binary-two-decimals.typ +82 -0
  97. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/compact-euros.typ +87 -0
  98. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/compact-numbers-int.typ +150 -0
  99. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/compact-numbers.typ +150 -0
  100. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/compact-sigfigs.typ +150 -0
  101. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/default-bytes.typ +82 -0
  102. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/default-engineering.typ +150 -0
  103. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/default-gbp.typ +87 -0
  104. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/default-integer.typ +150 -0
  105. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/default-numeric.typ +150 -0
  106. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/default-percentage.typ +87 -0
  107. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/default-scientific.typ +150 -0
  108. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/default-usd.typ +87 -0
  109. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/dollar-pattern-bytes.typ +82 -0
  110. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/dollar-pattern-currency.typ +87 -0
  111. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/dollar-pattern-eng.typ +150 -0
  112. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/dollar-pattern-int.typ +150 -0
  113. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/dollar-pattern-perc.typ +87 -0
  114. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/dollar-pattern-sci.typ +150 -0
  115. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/dollar-pattern.typ +150 -0
  116. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/drop-trailing-dec-mark-bytes.typ +82 -0
  117. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/drop-trailing-dec-mark-currency.typ +87 -0
  118. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/drop-trailing-dec-mark-eng.typ +150 -0
  119. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/drop-trailing-dec-mark-perc.typ +87 -0
  120. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/drop-trailing-dec-mark-sci.typ +150 -0
  121. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/drop-trailing-dec-mark.typ +150 -0
  122. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/drop-trailing-zeros-bytes.typ +82 -0
  123. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/drop-trailing-zeros-eng.typ +150 -0
  124. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/drop-trailing-zeros-perc.typ +87 -0
  125. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/drop-trailing-zeros-sci.typ +150 -0
  126. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/drop-trailing-zeros.typ +150 -0
  127. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/five-decimals-bytes.typ +82 -0
  128. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/five-decimals-currency.typ +87 -0
  129. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/five-decimals-eng.typ +150 -0
  130. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/five-decimals-perc.typ +87 -0
  131. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/five-decimals-sci.typ +150 -0
  132. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/five-decimals.typ +150 -0
  133. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/force-sign-and-currency.typ +87 -0
  134. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/force-sign-and-placement.typ +87 -0
  135. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/force-sign-eng.typ +150 -0
  136. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/force-sign-sci.typ +150 -0
  137. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/force-sign-symbol-bytes.typ +82 -0
  138. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/force-sign-symbol-currency.typ +87 -0
  139. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/force-sign-symbol-int.typ +150 -0
  140. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/force-sign-symbol-perc.typ +87 -0
  141. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/force-sign-symbol.typ +150 -0
  142. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/include-currency.typ +87 -0
  143. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/include-space.typ +87 -0
  144. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/just-top-row-bytes.typ +82 -0
  145. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/just-top-row-currency.typ +87 -0
  146. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/just-top-row-eng.typ +150 -0
  147. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/just-top-row-int.typ +150 -0
  148. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/just-top-row-perc.typ +87 -0
  149. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/just-top-row-sci.typ +150 -0
  150. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/just-top-row.typ +150 -0
  151. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/no-separators-bytes.typ +82 -0
  152. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/no-separators-currency.typ +87 -0
  153. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/no-separators-int.typ +150 -0
  154. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/no-separators-perc.typ +87 -0
  155. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/no-separators.typ +150 -0
  156. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/no-seps-sigfigs.typ +150 -0
  157. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/no-space-bytes.typ +82 -0
  158. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/placement-currency.typ +87 -0
  159. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/placement-left.typ +87 -0
  160. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/scale-by-10-currency.typ +87 -0
  161. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/scale-by-ten-eng.typ +150 -0
  162. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/scale-by-ten-int.typ +150 -0
  163. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/scale-by-ten-sci.typ +150 -0
  164. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/scale-by-ten.typ +150 -0
  165. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/scale-values.typ +87 -0
  166. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/three-sigfig-bytes.typ +82 -0
  167. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/three-sigfig-eng.typ +150 -0
  168. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/three-sigfig-sci.typ +150 -0
  169. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/three-sigfig.typ +150 -0
  170. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/use-different-marks-bytes.typ +82 -0
  171. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/use-different-marks-currency.typ +87 -0
  172. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/use-different-marks-eng.typ +150 -0
  173. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/use-different-marks-perc.typ +87 -0
  174. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/use-different-marks-sci.typ +150 -0
  175. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/__module__/use-different-marks.typ +150 -0
  176. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/test_bytes_special_values/bytes-special-values.typ +32 -0
  177. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/test_numeric_string_column/38852fc1-fc60-42d1-b559-054d076d00dc.typ +22 -0
  178. typ_tables-0.1.0/tests/__inline_snapshot__/test_formatting/test_string_column_fmt_numeric_and_integer/fc51b5f6-3c07-4def-b65e-e8c8d0c195bb.typ +33 -0
  179. typ_tables-0.1.0/tests/__inline_snapshot__/test_styling/TestSetGutter.test_gutter/78b68a21-ccc4-41bd-b689-dd6184842b00.typ +92 -0
  180. typ_tables-0.1.0/tests/__inline_snapshot__/test_styling/TestSetGutter.test_row_and_column_gutter/34f83f56-6e13-4cbe-bc54-8e9f569bc815.typ +92 -0
  181. typ_tables-0.1.0/tests/__inline_snapshot__/test_styling/TestSetInset.test_inset_dict/06d9a14e-f284-4f9a-9ad2-88922da8b5e9.typ +92 -0
  182. typ_tables-0.1.0/tests/__inline_snapshot__/test_styling/TestSetInset.test_inset_sides/3fb2f1a4-15db-461e-9c47-fbbecb697036.typ +92 -0
  183. typ_tables-0.1.0/tests/__inline_snapshot__/test_styling/TestSetRawStroke.test_stroke_function/17d0d3a4-399f-4cd9-80b0-26fc8eabc863.typ +21 -0
  184. typ_tables-0.1.0/tests/__inline_snapshot__/test_styling/TestStyleBody.test_fill_body_based_on_expr/efe8cbeb-53ef-4e0a-8424-c744bb08ba55.typ +137 -0
  185. typ_tables-0.1.0/tests/__inline_snapshot__/test_styling/TestStyleBody.test_fill_body_based_on_list/3d67d5ea-6872-42c0-a4b8-92b16fc18398.typ +137 -0
  186. typ_tables-0.1.0/tests/__inline_snapshot__/test_styling/TestStyleBody.test_fill_body_red_align_right/fade75d3-ba9c-4836-b955-7edf2296a004.typ +137 -0
  187. typ_tables-0.1.0/tests/__inline_snapshot__/test_styling/TestStyleBody.test_fill_body_red_align_right_then_fill_numeric_blue/67393b35-f334-488d-8506-323e7efd5a97.typ +137 -0
  188. typ_tables-0.1.0/tests/__inline_snapshot__/test_styling/TestStyleBody.test_fill_body_red_stub_column/ba104a36-efe8-40a6-a924-775284265054.typ +70 -0
  189. typ_tables-0.1.0/tests/__inline_snapshot__/test_styling/TestStyleColumnLabels.test_fill_column_labels/a320710c-9285-46cb-9e07-2efeae2333f7.typ +96 -0
  190. typ_tables-0.1.0/tests/__inline_snapshot__/test_styling/TestStyleHeader.test_align_to_right/9b8c38d9-61f4-4ae3-aea7-6491de7ccc07.typ +92 -0
  191. typ_tables-0.1.0/tests/__inline_snapshot__/test_styling/TestStyleHeader.test_change_top_border/dce36646-a219-460e-84d7-d72d78fb2b64.typ +92 -0
  192. typ_tables-0.1.0/tests/__inline_snapshot__/test_styling/TestStyleHeader.test_increase_text_size/39118e75-eb5e-4991-ab8d-bab8252da367.typ +94 -0
  193. typ_tables-0.1.0/tests/__inline_snapshot__/test_styling/TestStyleHeader.test_inset_top_bottom/4f62791f-a517-4c0a-88c5-c220988cdc50.typ +93 -0
  194. typ_tables-0.1.0/tests/__inline_snapshot__/test_styling/TestStyleRowGroup.test_fill_row_group_red/4345a4f0-2d5a-4d89-af4c-c30d7b6e257a.typ +74 -0
  195. typ_tables-0.1.0/tests/__inline_snapshot__/test_styling/TestStyleRowGroup.test_fill_row_groups_red_and_format/b393a321-59cd-43a5-8cb5-3c9ed3101014.typ +74 -0
  196. typ_tables-0.1.0/tests/__inline_snapshot__/test_styling/TestStyleRowGroup.test_fill_specific_row_group_red/6d836139-467f-490c-bb31-d179b2864e71.typ +72 -0
  197. typ_tables-0.1.0/tests/__inline_snapshot__/test_styling/TestStyleRowGroup.test_fill_specific_row_groups_red/94bd8900-5432-4e14-8fe2-cdbdcfabfb35.typ +72 -0
  198. typ_tables-0.1.0/tests/__inline_snapshot__/test_styling/TestStyleRowGroup.test_style_row_group_none_set/907dfd32-eed8-4d8f-88a7-99cb7647ba55.typ +79 -0
  199. typ_tables-0.1.0/tests/__inline_snapshot__/test_styling/TestStyleStub.test_fill_stub_red/fd8bca6a-032b-47a8-9f84-c867d340f239.typ +78 -0
  200. typ_tables-0.1.0/tests/__inline_snapshot__/test_styling/TestStyleStub.test_fill_stub_red_at_top/6343032e-15db-4f4f-9396-9f702e95f76e.typ +74 -0
  201. typ_tables-0.1.0/tests/__inline_snapshot__/test_styling/TestStyleStubhead.test_fill_stub_head/e16f9236-bae2-43fa-a5df-b3b98d644f5d.typ +72 -0
  202. typ_tables-0.1.0/tests/__inline_snapshot__/test_styling/test_apply_multiple_cell_styles/799a8d78-754f-4475-ae73-a067ac194699.typ +95 -0
  203. typ_tables-0.1.0/tests/__inline_snapshot__/test_styling/test_apply_multiple_text_styles/6b8ceccf-a7e6-417d-aead-f27ade6af900.typ +108 -0
  204. typ_tables-0.1.0/tests/__inline_snapshot__/test_styling/test_clear_style/18e3eacb-9137-4f4a-9b64-6229932c8ab2.typ +21 -0
  205. typ_tables-0.1.0/tests/__inline_snapshot__/test_styling/test_test_fractions/5447bc09-92ed-4a1e-babb-2719b59a54d2.typ +35 -0
  206. typ_tables-0.1.0/tests/__inline_snapshot__/test_to_typst/TestAlignColumns.test_align_numeric_columns_right/560ef812-0edd-4fc6-bb68-5c1f626a4662.typ +83 -0
  207. typ_tables-0.1.0/tests/__inline_snapshot__/test_to_typst/TestBasic.test_to_typst_escaped/f944eeb4-ed3d-44aa-ad20-0e29e69356cc.typ +82 -0
  208. typ_tables-0.1.0/tests/__inline_snapshot__/test_to_typst/TestBasic.test_to_typst_format_header/80b276c0-46d7-48d4-98a6-10588ca067f0.typ +70 -0
  209. typ_tables-0.1.0/tests/__inline_snapshot__/test_to_typst/TestBasic.test_to_typst_groupname_col/3929626d-bdef-4d46-a714-4f1317e59368.typ +61 -0
  210. typ_tables-0.1.0/tests/__inline_snapshot__/test_to_typst/TestBasic.test_to_typst_rowname_col_reorders_columns/c6ef5a0d-192b-4311-9f2b-c60ebb17cc3d.typ +57 -0
  211. typ_tables-0.1.0/tests/__inline_snapshot__/test_to_typst/TestBasic.test_to_typst_rowname_col_with_stubhead/5a710293-3fba-423e-a890-1e7cfcc0c0c6.typ +57 -0
  212. typ_tables-0.1.0/tests/__inline_snapshot__/test_to_typst/TestBasic.test_to_typst_rowname_col_with_title/0fa6495c-840e-4777-a51c-45a54abd27a4.typ +66 -0
  213. typ_tables-0.1.0/tests/__inline_snapshot__/test_to_typst/TestBasic.test_to_typst_string_int_float/dfe29286-a9ca-477b-be00-4ffd55201fc1.typ +57 -0
  214. typ_tables-0.1.0/tests/__inline_snapshot__/test_to_typst/TestBasic.test_to_typst_string_int_float_with_missing/e8d0edad-ae47-441a-940a-82555cbed295.typ +10 -0
  215. typ_tables-0.1.0/tests/__inline_snapshot__/test_to_typst/TestEdgeCases.test_column_label_with_underscore/ebeb174f-9dfd-4dcf-800d-71d00af6e936.typ +22 -0
  216. typ_tables-0.1.0/tests/__inline_snapshot__/test_to_typst/TestEdgeCases.test_group_column_with_align_set/7b3effea-cf1a-4eb4-bd9f-77e626389c12.typ +61 -0
  217. typ_tables-0.1.0/tests/__inline_snapshot__/test_to_typst/TestEdgeCases.test_group_column_with_bottom_row_stroke_styled/1b1f2aa9-97bf-44ce-96ba-87f304d3ae6a.typ +61 -0
  218. typ_tables-0.1.0/tests/__inline_snapshot__/test_to_typst/TestEdgeCases.test_group_column_with_stubhead/e00d6285-8d9c-4ce6-8eb5-a9cce90e5f67.typ +61 -0
  219. typ_tables-0.1.0/tests/__inline_snapshot__/test_to_typst/TestHideColumns.test_hide_given_columns/23b96023-753e-4f75-8646-d315756f2cfd.typ +60 -0
  220. typ_tables-0.1.0/tests/__inline_snapshot__/test_to_typst/TestLabelColumns.test_label_with_raw_typst/10644c46-4d17-402c-b326-1aef158b9111.typ +83 -0
  221. typ_tables-0.1.0/tests/__inline_snapshot__/test_to_typst/TestLabelColumns.test_label_with_raw_typst/ab19ec62-2064-42f5-9b21-2e9a681e828a.typ +11 -0
  222. typ_tables-0.1.0/tests/__inline_snapshot__/test_to_typst/TestLabelColumns.test_label_with_string/ab19ec62-2064-42f5-9b21-2e9a681e828a.typ +83 -0
  223. typ_tables-0.1.0/tests/__inline_snapshot__/test_to_typst/TestLabelColumnsWith.test_label_upper/d2909bac-35bc-4711-80a1-47e641781530.typ +83 -0
  224. typ_tables-0.1.0/tests/__inline_snapshot__/test_to_typst/TestLabelColumnsWith.test_label_with_raw_typst_func/b4b1d349-8c99-488d-9bde-a553cb59dff6.typ +83 -0
  225. typ_tables-0.1.0/tests/conftest.py +63 -0
  226. typ_tables-0.1.0/tests/test_adding_elements.py +57 -0
  227. typ_tables-0.1.0/tests/test_date_time.py +295 -0
  228. typ_tables-0.1.0/tests/test_fmt_tf.py +209 -0
  229. typ_tables-0.1.0/tests/test_formatting.py +693 -0
  230. typ_tables-0.1.0/tests/test_location.py +56 -0
  231. typ_tables-0.1.0/tests/test_styling.py +689 -0
  232. typ_tables-0.1.0/tests/test_to_typst.py +291 -0
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2026 Benjamin Askew-Gale
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,108 @@
1
+ Metadata-Version: 2.4
2
+ Name: typ-tables
3
+ Version: 0.1.0
4
+ Summary: Add your description here
5
+ Keywords: tables,Typst
6
+ Author: Benjamin Askew-Gale
7
+ License-Expression: MIT
8
+ Classifier: Programming Language :: Python
9
+ Classifier: Programming Language :: Python :: 3.11
10
+ Classifier: Programming Language :: Python :: 3.12
11
+ Classifier: Programming Language :: Python :: 3.13
12
+ Classifier: Programming Language :: Python :: 3.14
13
+ Classifier: Topic :: Scientific/Engineering :: Visualization
14
+ Project-URL: homepage, https://github.com/BenGale93/typ-tables
15
+ Project-URL: documentation, https://bengale93.github.io/typ-tables/
16
+ Requires-Python: >=3.11
17
+ Requires-Dist: narwhals>=2.7.0
18
+ Description-Content-Type: text/markdown
19
+
20
+ # typ-tables
21
+
22
+ Inspired by
23
+ [great_tables](https://posit-dev.github.io/great-tables/articles/intro.html), a
24
+ way to turn DataFrames into Typst tables.
25
+
26
+ Tables that look like
27
+
28
+ ![rendered table](./docs/images/readme_snippet.png)
29
+
30
+ Created using the following Python script:
31
+
32
+ ```python
33
+ import polars as pl
34
+ from typ_tables import TypTable
35
+
36
+ df = pl.DataFrame(
37
+ {
38
+ "string": ["a", "b", "c"],
39
+ "int": [10, 10000, 1000000],
40
+ "float": [0.000001, 0.1368753, 163985.8374],
41
+ }
42
+ )
43
+
44
+ table = TypTable(df)
45
+ result = table.to_typst()
46
+ ```
47
+
48
+ Which gives you the following typst snippet:
49
+
50
+ ```typ
51
+ #table(
52
+ columns: 3,
53
+ column-gutter: (),
54
+ row-gutter: (),
55
+ stroke: none,
56
+ align: (auto, auto, auto),
57
+ inset: 0% + 5pt,
58
+ table.header(table.cell(
59
+ stroke: (bottom: 1.2pt),
60
+ [string],
61
+ ), table.cell(
62
+ stroke: (bottom: 1.2pt),
63
+ [int],
64
+ ), table.cell(
65
+ stroke: (bottom: 1.2pt),
66
+ [float],
67
+ ),),
68
+ table.cell(
69
+ colspan: 1,
70
+ stroke: (bottom: 0.6pt),
71
+ [a],
72
+ ), table.cell(
73
+ colspan: 1,
74
+ stroke: (bottom: 0.6pt),
75
+ [10],
76
+ ), table.cell(
77
+ colspan: 1,
78
+ stroke: (bottom: 0.6pt),
79
+ [1e-06],
80
+ ),
81
+ table.cell(
82
+ colspan: 1,
83
+ stroke: (bottom: 0.6pt),
84
+ [b],
85
+ ), table.cell(
86
+ colspan: 1,
87
+ stroke: (bottom: 0.6pt),
88
+ [10000],
89
+ ), table.cell(
90
+ colspan: 1,
91
+ stroke: (bottom: 0.6pt),
92
+ [0.1368753],
93
+ ),
94
+ table.cell(
95
+ colspan: 1,
96
+ stroke: (bottom: 0.6pt),
97
+ [c],
98
+ ), table.cell(
99
+ colspan: 1,
100
+ stroke: (bottom: 0.6pt),
101
+ [1000000],
102
+ ), table.cell(
103
+ colspan: 1,
104
+ stroke: (bottom: 0.6pt),
105
+ [163985.8374],
106
+ ),
107
+ )
108
+ ```
@@ -0,0 +1,89 @@
1
+ # typ-tables
2
+
3
+ Inspired by
4
+ [great_tables](https://posit-dev.github.io/great-tables/articles/intro.html), a
5
+ way to turn DataFrames into Typst tables.
6
+
7
+ Tables that look like
8
+
9
+ ![rendered table](./docs/images/readme_snippet.png)
10
+
11
+ Created using the following Python script:
12
+
13
+ ```python
14
+ import polars as pl
15
+ from typ_tables import TypTable
16
+
17
+ df = pl.DataFrame(
18
+ {
19
+ "string": ["a", "b", "c"],
20
+ "int": [10, 10000, 1000000],
21
+ "float": [0.000001, 0.1368753, 163985.8374],
22
+ }
23
+ )
24
+
25
+ table = TypTable(df)
26
+ result = table.to_typst()
27
+ ```
28
+
29
+ Which gives you the following typst snippet:
30
+
31
+ ```typ
32
+ #table(
33
+ columns: 3,
34
+ column-gutter: (),
35
+ row-gutter: (),
36
+ stroke: none,
37
+ align: (auto, auto, auto),
38
+ inset: 0% + 5pt,
39
+ table.header(table.cell(
40
+ stroke: (bottom: 1.2pt),
41
+ [string],
42
+ ), table.cell(
43
+ stroke: (bottom: 1.2pt),
44
+ [int],
45
+ ), table.cell(
46
+ stroke: (bottom: 1.2pt),
47
+ [float],
48
+ ),),
49
+ table.cell(
50
+ colspan: 1,
51
+ stroke: (bottom: 0.6pt),
52
+ [a],
53
+ ), table.cell(
54
+ colspan: 1,
55
+ stroke: (bottom: 0.6pt),
56
+ [10],
57
+ ), table.cell(
58
+ colspan: 1,
59
+ stroke: (bottom: 0.6pt),
60
+ [1e-06],
61
+ ),
62
+ table.cell(
63
+ colspan: 1,
64
+ stroke: (bottom: 0.6pt),
65
+ [b],
66
+ ), table.cell(
67
+ colspan: 1,
68
+ stroke: (bottom: 0.6pt),
69
+ [10000],
70
+ ), table.cell(
71
+ colspan: 1,
72
+ stroke: (bottom: 0.6pt),
73
+ [0.1368753],
74
+ ),
75
+ table.cell(
76
+ colspan: 1,
77
+ stroke: (bottom: 0.6pt),
78
+ [c],
79
+ ), table.cell(
80
+ colspan: 1,
81
+ stroke: (bottom: 0.6pt),
82
+ [1000000],
83
+ ), table.cell(
84
+ colspan: 1,
85
+ stroke: (bottom: 0.6pt),
86
+ [163985.8374],
87
+ ),
88
+ )
89
+ ```
@@ -0,0 +1,129 @@
1
+ [project]
2
+ name = "typ-tables"
3
+ dynamic = []
4
+ description = "Add your description here"
5
+ readme = "README.md"
6
+ requires-python = ">=3.11"
7
+ dependencies = [
8
+ "narwhals>=2.7.0",
9
+ ]
10
+ license = "MIT"
11
+ authors = [
12
+ { name = "Benjamin Askew-Gale" },
13
+ ]
14
+ classifiers = [
15
+ "Programming Language :: Python",
16
+ "Programming Language :: Python :: 3.11",
17
+ "Programming Language :: Python :: 3.12",
18
+ "Programming Language :: Python :: 3.13",
19
+ "Programming Language :: Python :: 3.14",
20
+ "Topic :: Scientific/Engineering :: Visualization",
21
+ ]
22
+ keywords = [
23
+ "tables",
24
+ "Typst",
25
+ ]
26
+ version = "0.1.0"
27
+
28
+ [project.urls]
29
+ homepage = "https://github.com/BenGale93/typ-tables"
30
+ documentation = "https://bengale93.github.io/typ-tables/"
31
+
32
+ [project.scripts]
33
+
34
+ [dependency-groups]
35
+ dev = [
36
+ { include-group = "lint" },
37
+ { include-group = "test" },
38
+ { include-group = "typing" },
39
+ ]
40
+ docs = [
41
+ "mkdocstrings>=1.0.4",
42
+ "mkdocstrings-python>=2.0.3",
43
+ "pillow>=12.2.0",
44
+ "zensical>=0.0.38",
45
+ ]
46
+ lint = [
47
+ "ruff>=0.15.6",
48
+ ]
49
+ test = [
50
+ "pytest>=9.0.2",
51
+ "pytest-randomly>=4.0.1",
52
+ "pytest-cov>=7.0.0",
53
+ "inline-snapshot>=0.32.5",
54
+ "polars>=1.39.3",
55
+ "typst>=0.14.8",
56
+ "pandas>=3.0.0",
57
+ "pyarrow>=20.0.0",
58
+ ]
59
+ typing = [
60
+ "pyrefly>=0.61.0",
61
+ ]
62
+ typing-test = [
63
+ { include-group = "test" },
64
+ { include-group = "typing" },
65
+ ]
66
+
67
+ [build-system]
68
+ requires = [
69
+ "pdm-backend==2.4.7",
70
+ ]
71
+ build-backend = "pdm.backend"
72
+
73
+ [tool.pdm.version]
74
+ source = "scm"
75
+
76
+ [tool.uv]
77
+ resolution = "lowest-direct"
78
+
79
+ [tool.ruff]
80
+ line-length = 100
81
+ target-version = "py311"
82
+
83
+ [tool.ruff.format]
84
+ docstring-code-format = true
85
+
86
+ [tool.ruff.lint]
87
+ select = [
88
+ "ALL",
89
+ ]
90
+ ignore = [
91
+ "COM812",
92
+ "ISC001",
93
+ "ANN401",
94
+ "SLF001",
95
+ "DTZ",
96
+ ]
97
+
98
+ [tool.ruff.lint.per-file-ignores]
99
+ "tests/**" = [
100
+ "D",
101
+ "S",
102
+ "ANN",
103
+ "PLR2004",
104
+ ]
105
+
106
+ [tool.ruff.lint.pydocstyle]
107
+ convention = "google"
108
+
109
+ [tool.coverage.report]
110
+ exclude_also = [
111
+ "if t.TYPE_CHECKING",
112
+ "@t.overload",
113
+ "@abstractmethod",
114
+ "if TYPE_CHECKING",
115
+ ]
116
+ show_missing = true
117
+
118
+ [tool.coverage.run]
119
+ branch = true
120
+
121
+ [tool.pytest.ini_options]
122
+ addopts = "--cov=src/ --cov-report="
123
+ filterwarnings = [
124
+ "ignore::DeprecationWarning::",
125
+ "default::DeprecationWarning:typ-tables.*:",
126
+ ]
127
+
128
+ [tool.inline-snapshot]
129
+ format-command = "uv run ruff format --stdin-filename {filename}"