rs-rich 0.0.1__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 (507) hide show
  1. rs_rich-0.0.1/PKG-INFO +72 -0
  2. rs_rich-0.0.1/README.md +56 -0
  3. rs_rich-0.0.1/pyproject.toml +32 -0
  4. rs_rich-0.0.1/python/rs_rich/__init__.py +60 -0
  5. rs_rich-0.0.1/python/rs_rich/__main__.py +8 -0
  6. rs_rich-0.0.1/python/rs_rich/_native.pyi +4348 -0
  7. rs_rich-0.0.1/python/rs_rich/_null_file.py +77 -0
  8. rs_rich-0.0.1/python/rs_rich/align.py +5 -0
  9. rs_rich-0.0.1/python/rs_rich/art/__init__.py +78 -0
  10. rs_rich-0.0.1/python/rs_rich/art/ascii.py +5 -0
  11. rs_rich-0.0.1/python/rs_rich/art/block.py +5 -0
  12. rs_rich-0.0.1/python/rs_rich/art/braille.py +5 -0
  13. rs_rich-0.0.1/python/rs_rich/art/figlet.py +8 -0
  14. rs_rich-0.0.1/python/rs_rich/art/gif.py +5 -0
  15. rs_rich-0.0.1/python/rs_rich/art/image_art.py +5 -0
  16. rs_rich-0.0.1/python/rs_rich/art/imagediff.py +8 -0
  17. rs_rich-0.0.1/python/rs_rich/art/quadrant.py +5 -0
  18. rs_rich-0.0.1/python/rs_rich/art/sixel.py +10 -0
  19. rs_rich-0.0.1/python/rs_rich/art/stage.py +5 -0
  20. rs_rich-0.0.1/python/rs_rich/bar.py +5 -0
  21. rs_rich-0.0.1/python/rs_rich/box.py +47 -0
  22. rs_rich-0.0.1/python/rs_rich/cli.py +111 -0
  23. rs_rich-0.0.1/python/rs_rich/color.py +21 -0
  24. rs_rich-0.0.1/python/rs_rich/columns.py +5 -0
  25. rs_rich-0.0.1/python/rs_rich/console.py +27 -0
  26. rs_rich-0.0.1/python/rs_rich/constrain.py +5 -0
  27. rs_rich-0.0.1/python/rs_rich/containers.py +5 -0
  28. rs_rich-0.0.1/python/rs_rich/emoji.py +9 -0
  29. rs_rich-0.0.1/python/rs_rich/errors.py +25 -0
  30. rs_rich-0.0.1/python/rs_rich/ext/__init__.py +481 -0
  31. rs_rich-0.0.1/python/rs_rich/ext/a11y.py +36 -0
  32. rs_rich-0.0.1/python/rs_rich/ext/ansi_explain.py +28 -0
  33. rs_rich-0.0.1/python/rs_rich/ext/badge.py +20 -0
  34. rs_rich-0.0.1/python/rs_rich/ext/cancel.py +12 -0
  35. rs_rich-0.0.1/python/rs_rich/ext/capabilities.py +22 -0
  36. rs_rich-0.0.1/python/rs_rich/ext/cli_doc.py +50 -0
  37. rs_rich-0.0.1/python/rs_rich/ext/countdown.py +26 -0
  38. rs_rich-0.0.1/python/rs_rich/ext/dashboard.py +12 -0
  39. rs_rich-0.0.1/python/rs_rich/ext/data.py +86 -0
  40. rs_rich-0.0.1/python/rs_rich/ext/derive.py +24 -0
  41. rs_rich-0.0.1/python/rs_rich/ext/diagnostic.py +20 -0
  42. rs_rich-0.0.1/python/rs_rich/ext/diff.py +66 -0
  43. rs_rich-0.0.1/python/rs_rich/ext/encoding.py +20 -0
  44. rs_rich-0.0.1/python/rs_rich/ext/env_inspect.py +24 -0
  45. rs_rich-0.0.1/python/rs_rich/ext/event.py +12 -0
  46. rs_rich-0.0.1/python/rs_rich/ext/fidelity.py +24 -0
  47. rs_rich-0.0.1/python/rs_rich/ext/format.py +46 -0
  48. rs_rich-0.0.1/python/rs_rich/ext/hex.py +18 -0
  49. rs_rich-0.0.1/python/rs_rich/ext/highlighter.py +12 -0
  50. rs_rich-0.0.1/python/rs_rich/ext/hyperlink.py +14 -0
  51. rs_rich-0.0.1/python/rs_rich/ext/layout.py +22 -0
  52. rs_rich-0.0.1/python/rs_rich/ext/live.py +16 -0
  53. rs_rich-0.0.1/python/rs_rich/ext/log_handler.py +20 -0
  54. rs_rich-0.0.1/python/rs_rich/ext/notify.py +14 -0
  55. rs_rich-0.0.1/python/rs_rich/ext/qa.py +49 -0
  56. rs_rich-0.0.1/python/rs_rich/ext/redact.py +26 -0
  57. rs_rich-0.0.1/python/rs_rich/ext/registry.py +10 -0
  58. rs_rich-0.0.1/python/rs_rich/ext/sanitize.py +18 -0
  59. rs_rich-0.0.1/python/rs_rich/ext/size_bar.py +18 -0
  60. rs_rich-0.0.1/python/rs_rich/ext/source_view.py +12 -0
  61. rs_rich-0.0.1/python/rs_rich/ext/stacktrace.py +24 -0
  62. rs_rich-0.0.1/python/rs_rich/ext/table.py +38 -0
  63. rs_rich-0.0.1/python/rs_rich/ext/target.py +18 -0
  64. rs_rich-0.0.1/python/rs_rich/ext/testing.py +22 -0
  65. rs_rich-0.0.1/python/rs_rich/ext/theme.py +16 -0
  66. rs_rich-0.0.1/python/rs_rich/ext/transfer.py +26 -0
  67. rs_rich-0.0.1/python/rs_rich/ext/transform.py +20 -0
  68. rs_rich-0.0.1/python/rs_rich/ext/unicode_inspect.py +24 -0
  69. rs_rich-0.0.1/python/rs_rich/ext/workflow.py +40 -0
  70. rs_rich-0.0.1/python/rs_rich/highlighter.py +23 -0
  71. rs_rich-0.0.1/python/rs_rich/json.py +5 -0
  72. rs_rich-0.0.1/python/rs_rich/layout.py +23 -0
  73. rs_rich-0.0.1/python/rs_rich/live.py +5 -0
  74. rs_rich-0.0.1/python/rs_rich/live_render.py +5 -0
  75. rs_rich-0.0.1/python/rs_rich/logging.py +5 -0
  76. rs_rich-0.0.1/python/rs_rich/markdown.py +9 -0
  77. rs_rich-0.0.1/python/rs_rich/markup.py +6 -0
  78. rs_rich-0.0.1/python/rs_rich/measure.py +5 -0
  79. rs_rich-0.0.1/python/rs_rich/mermaid.py +71 -0
  80. rs_rich-0.0.1/python/rs_rich/padding.py +5 -0
  81. rs_rich-0.0.1/python/rs_rich/pager.py +5 -0
  82. rs_rich-0.0.1/python/rs_rich/panel.py +5 -0
  83. rs_rich-0.0.1/python/rs_rich/plugins.py +73 -0
  84. rs_rich-0.0.1/python/rs_rich/pretty.py +10 -0
  85. rs_rich-0.0.1/python/rs_rich/progress.py +45 -0
  86. rs_rich-0.0.1/python/rs_rich/progress_bar.py +5 -0
  87. rs_rich-0.0.1/python/rs_rich/prompt.py +21 -0
  88. rs_rich-0.0.1/python/rs_rich/py.typed +0 -0
  89. rs_rich-0.0.1/python/rs_rich/rule.py +5 -0
  90. rs_rich-0.0.1/python/rs_rich/screen.py +5 -0
  91. rs_rich-0.0.1/python/rs_rich/segment.py +5 -0
  92. rs_rich-0.0.1/python/rs_rich/spinner.py +5 -0
  93. rs_rich-0.0.1/python/rs_rich/status.py +5 -0
  94. rs_rich-0.0.1/python/rs_rich/style.py +5 -0
  95. rs_rich-0.0.1/python/rs_rich/styled.py +5 -0
  96. rs_rich-0.0.1/python/rs_rich/syntax.py +13 -0
  97. rs_rich-0.0.1/python/rs_rich/table.py +5 -0
  98. rs_rich-0.0.1/python/rs_rich/terminal_theme.py +19 -0
  99. rs_rich-0.0.1/python/rs_rich/text.py +5 -0
  100. rs_rich-0.0.1/python/rs_rich/theme.py +5 -0
  101. rs_rich-0.0.1/python/rs_rich/traceback.py +9 -0
  102. rs_rich-0.0.1/python/rs_rich/tree.py +5 -0
  103. rs_rich-0.0.1/rich/Cargo.toml +57 -0
  104. rs_rich-0.0.1/rich/LICENSE +27 -0
  105. rs_rich-0.0.1/rich/README.md +74 -0
  106. rs_rich-0.0.1/rich/src/align.rs +353 -0
  107. rs_rich-0.0.1/rich/src/ansi.rs +351 -0
  108. rs_rich-0.0.1/rich/src/bar.rs +153 -0
  109. rs_rich-0.0.1/rich/src/box.rs +462 -0
  110. rs_rich-0.0.1/rich/src/cell_widths.rs +7393 -0
  111. rs_rich-0.0.1/rich/src/cells.rs +682 -0
  112. rs_rich-0.0.1/rich/src/color.rs +662 -0
  113. rs_rich-0.0.1/rich/src/color_names.rs +250 -0
  114. rs_rich-0.0.1/rich/src/columns.rs +389 -0
  115. rs_rich-0.0.1/rich/src/console.rs +2284 -0
  116. rs_rich-0.0.1/rich/src/constrain.rs +65 -0
  117. rs_rich-0.0.1/rich/src/containers.rs +78 -0
  118. rs_rich-0.0.1/rich/src/control.rs +226 -0
  119. rs_rich-0.0.1/rich/src/emoji.rs +168 -0
  120. rs_rich-0.0.1/rich/src/emoji_codes.rs +5843 -0
  121. rs_rich-0.0.1/rich/src/errors.rs +53 -0
  122. rs_rich-0.0.1/rich/src/export.rs +225 -0
  123. rs_rich-0.0.1/rich/src/filesize.rs +155 -0
  124. rs_rich-0.0.1/rich/src/highlighter.rs +345 -0
  125. rs_rich-0.0.1/rich/src/json.rs +1721 -0
  126. rs_rich-0.0.1/rich/src/layout.rs +740 -0
  127. rs_rich-0.0.1/rich/src/lib.rs +135 -0
  128. rs_rich-0.0.1/rich/src/live.rs +485 -0
  129. rs_rich-0.0.1/rich/src/live_render.rs +220 -0
  130. rs_rich-0.0.1/rich/src/log_render.rs +381 -0
  131. rs_rich-0.0.1/rich/src/markdown.rs +2953 -0
  132. rs_rich-0.0.1/rich/src/markdown_url.rs +705 -0
  133. rs_rich-0.0.1/rich/src/markup.rs +453 -0
  134. rs_rich-0.0.1/rich/src/measure.rs +65 -0
  135. rs_rich-0.0.1/rich/src/padding.rs +193 -0
  136. rs_rich-0.0.1/rich/src/pager.rs +231 -0
  137. rs_rich-0.0.1/rich/src/panel.rs +567 -0
  138. rs_rich-0.0.1/rich/src/pretty.rs +94 -0
  139. rs_rich-0.0.1/rich/src/progress.rs +1860 -0
  140. rs_rich-0.0.1/rich/src/progress_bar.rs +335 -0
  141. rs_rich-0.0.1/rich/src/prompt.rs +519 -0
  142. rs_rich-0.0.1/rich/src/protocol.rs +317 -0
  143. rs_rich-0.0.1/rich/src/pyformat.rs +825 -0
  144. rs_rich-0.0.1/rich/src/ratio.rs +148 -0
  145. rs_rich-0.0.1/rich/src/region.rs +23 -0
  146. rs_rich-0.0.1/rich/src/repr_patterns.rs +10 -0
  147. rs_rich-0.0.1/rich/src/rule.rs +287 -0
  148. rs_rich-0.0.1/rich/src/screen.rs +106 -0
  149. rs_rich-0.0.1/rich/src/segment.rs +617 -0
  150. rs_rich-0.0.1/rich/src/spinner.rs +252 -0
  151. rs_rich-0.0.1/rich/src/spinner_data.rs +159 -0
  152. rs_rich-0.0.1/rich/src/status.rs +154 -0
  153. rs_rich-0.0.1/rich/src/style.rs +822 -0
  154. rs_rich-0.0.1/rich/src/styled.rs +69 -0
  155. rs_rich-0.0.1/rich/src/svg.rs +467 -0
  156. rs_rich-0.0.1/rich/src/syntax.rs +1560 -0
  157. rs_rich-0.0.1/rich/src/syntax_cache.rs +184 -0
  158. rs_rich-0.0.1/rich/src/syntax_syntect.rs +559 -0
  159. rs_rich-0.0.1/rich/src/table.rs +1982 -0
  160. rs_rich-0.0.1/rich/src/terminal_theme.rs +220 -0
  161. rs_rich-0.0.1/rich/src/text.rs +2285 -0
  162. rs_rich-0.0.1/rich/src/theme.rs +734 -0
  163. rs_rich-0.0.1/rich/src/traceback.rs +141 -0
  164. rs_rich-0.0.1/rich/src/tree.rs +460 -0
  165. rs_rich-0.0.1/rich/src/wrap.rs +136 -0
  166. rs_rich-0.0.1/rich-art/Cargo.toml +113 -0
  167. rs_rich-0.0.1/rich-art/LICENSE +27 -0
  168. rs_rich-0.0.1/rich-art/README.md +219 -0
  169. rs_rich-0.0.1/rich-art/examples/assets/ball.gif +0 -0
  170. rs_rich-0.0.1/rich-art/examples/assets/cat.gif +0 -0
  171. rs_rich-0.0.1/rich-art/examples/assets/waving_cat.gif +0 -0
  172. rs_rich-0.0.1/rich-art/examples/banner.rs +23 -0
  173. rs_rich-0.0.1/rich-art/examples/diff_report.rs +79 -0
  174. rs_rich-0.0.1/rich-art/examples/gif.rs +42 -0
  175. rs_rich-0.0.1/rich-art/examples/guide_banners.rs +126 -0
  176. rs_rich-0.0.1/rich-art/examples/guide_gifs.rs +196 -0
  177. rs_rich-0.0.1/rich-art/examples/guide_image_diff.rs +189 -0
  178. rs_rich-0.0.1/rich-art/examples/guide_images.rs +455 -0
  179. rs_rich-0.0.1/rich-art/examples/make_demo_gif.rs +207 -0
  180. rs_rich-0.0.1/rich-art/examples/shrink_asset.rs +56 -0
  181. rs_rich-0.0.1/rich-art/examples/stage.rs +46 -0
  182. rs_rich-0.0.1/rich-art/fonts/README.md +36 -0
  183. rs_rich-0.0.1/rich-art/fonts/standard.flf +2237 -0
  184. rs_rich-0.0.1/rich-art/src/ascii.rs +407 -0
  185. rs_rich-0.0.1/rich-art/src/block.rs +315 -0
  186. rs_rich-0.0.1/rich-art/src/braille.rs +158 -0
  187. rs_rich-0.0.1/rich-art/src/figlet.rs +647 -0
  188. rs_rich-0.0.1/rich-art/src/gif.rs +848 -0
  189. rs_rich-0.0.1/rich-art/src/image_art.rs +1915 -0
  190. rs_rich-0.0.1/rich-art/src/image_color.rs +776 -0
  191. rs_rich-0.0.1/rich-art/src/imagediff.rs +671 -0
  192. rs_rich-0.0.1/rich-art/src/lib.rs +225 -0
  193. rs_rich-0.0.1/rich-art/src/quadrant.rs +352 -0
  194. rs_rich-0.0.1/rich-art/src/sixel.rs +756 -0
  195. rs_rich-0.0.1/rich-art/src/stage.rs +470 -0
  196. rs_rich-0.0.1/rich-art/src/transform.rs +282 -0
  197. rs_rich-0.0.1/rich-art/tests/alpha_backgrounds.rs +356 -0
  198. rs_rich-0.0.1/rich-art/tests/figlet_parity.rs +69 -0
  199. rs_rich-0.0.1/rich-art/tests/fixtures/halo-after.png +0 -0
  200. rs_rich-0.0.1/rich-art/tests/fixtures/halo-before.png +0 -0
  201. rs_rich-0.0.1/rich-art/tests/fixtures/halo-expected.json +29 -0
  202. rs_rich-0.0.1/rich-art/tests/golden/figlet.tsv +18 -0
  203. rs_rich-0.0.1/rich-art/tests/image_color.rs +233 -0
  204. rs_rich-0.0.1/rich-art/tests/image_modes.rs +269 -0
  205. rs_rich-0.0.1/rich-art/tests/imagediff_parity.rs +151 -0
  206. rs_rich-0.0.1/rich-art/tests/native_sizing_edges.rs +81 -0
  207. rs_rich-0.0.1/rich-art/tests/raster_acceptance.rs +100 -0
  208. rs_rich-0.0.1/rich-art/tests/transforms.rs +41 -0
  209. rs_rich-0.0.1/rich-cli/Cargo.toml +86 -0
  210. rs_rich-0.0.1/rich-cli/LICENSE +27 -0
  211. rs_rich-0.0.1/rich-cli/README.md +225 -0
  212. rs_rich-0.0.1/rich-cli/src/authoring.rs +269 -0
  213. rs_rich-0.0.1/rich-cli/src/batch.rs +745 -0
  214. rs_rich-0.0.1/rich-cli/src/batch_output.rs +273 -0
  215. rs_rich-0.0.1/rich-cli/src/batch_paths.rs +304 -0
  216. rs_rich-0.0.1/rich-cli/src/batch_races.rs +283 -0
  217. rs_rich-0.0.1/rich-cli/src/cli_spec.rs +1613 -0
  218. rs_rich-0.0.1/rich-cli/src/config.rs +1635 -0
  219. rs_rich-0.0.1/rich-cli/src/controls.rs +154 -0
  220. rs_rich-0.0.1/rich-cli/src/demo.rs +821 -0
  221. rs_rich-0.0.1/rich-cli/src/doctor.rs +357 -0
  222. rs_rich-0.0.1/rich-cli/src/inspect.rs +566 -0
  223. rs_rich-0.0.1/rich-cli/src/lib.rs +7020 -0
  224. rs_rich-0.0.1/rich-cli/src/main.rs +12 -0
  225. rs_rich-0.0.1/rich-cli/src/render_target.rs +62 -0
  226. rs_rich-0.0.1/rich-cli/src/structured_log.rs +72 -0
  227. rs_rich-0.0.1/rich-cli/src/tools.rs +542 -0
  228. rs_rich-0.0.1/rich-cli/src/viewers.rs +962 -0
  229. rs_rich-0.0.1/rich-cli/src/watch.rs +848 -0
  230. rs_rich-0.0.1/rich-ext/Cargo.toml +170 -0
  231. rs_rich-0.0.1/rich-ext/LICENSE +27 -0
  232. rs_rich-0.0.1/rich-ext/README.md +281 -0
  233. rs_rich-0.0.1/rich-ext/examples/clap_help.rs +99 -0
  234. rs_rich-0.0.1/rich-ext/examples/dashboard.rs +24 -0
  235. rs_rich-0.0.1/rich-ext/examples/diagnostic.rs +27 -0
  236. rs_rich-0.0.1/rich-ext/examples/expanded_release.rs +71 -0
  237. rs_rich-0.0.1/rich-ext/examples/guide_a11y.rs +222 -0
  238. rs_rich-0.0.1/rich-ext/examples/guide_ansi.rs +126 -0
  239. rs_rich-0.0.1/rich-ext/examples/guide_badges.rs +202 -0
  240. rs_rich-0.0.1/rich-ext/examples/guide_capabilities.rs +269 -0
  241. rs_rich-0.0.1/rich-ext/examples/guide_clap.rs +141 -0
  242. rs_rich-0.0.1/rich-ext/examples/guide_cli.rs +250 -0
  243. rs_rich-0.0.1/rich-ext/examples/guide_data.rs +336 -0
  244. rs_rich-0.0.1/rich-ext/examples/guide_diagnostics.rs +305 -0
  245. rs_rich-0.0.1/rich-ext/examples/guide_diff.rs +280 -0
  246. rs_rich-0.0.1/rich-ext/examples/guide_extensions.rs +221 -0
  247. rs_rich-0.0.1/rich-ext/examples/guide_highlighters.rs +131 -0
  248. rs_rich-0.0.1/rich-ext/examples/guide_live_layout.rs +252 -0
  249. rs_rich-0.0.1/rich-ext/examples/guide_logging.rs +358 -0
  250. rs_rich-0.0.1/rich-ext/examples/guide_macros.rs +227 -0
  251. rs_rich-0.0.1/rich-ext/examples/guide_qa.rs +415 -0
  252. rs_rich-0.0.1/rich-ext/examples/guide_tables_ext.rs +228 -0
  253. rs_rich-0.0.1/rich-ext/examples/guide_transfers.rs +266 -0
  254. rs_rich-0.0.1/rich-ext/examples/guide_transforms.rs +129 -0
  255. rs_rich-0.0.1/rich-ext/examples/guide_workflow.rs +203 -0
  256. rs_rich-0.0.1/rich-ext/examples/layout.rs +20 -0
  257. rs_rich-0.0.1/rich-ext/examples/live_regions.rs +58 -0
  258. rs_rich-0.0.1/rich-ext/examples/log_adapter.rs +20 -0
  259. rs_rich-0.0.1/rich-ext/examples/rich_handler.rs +28 -0
  260. rs_rich-0.0.1/rich-ext/examples/snapshot.rs +27 -0
  261. rs_rich-0.0.1/rich-ext/examples/structured_data.rs +51 -0
  262. rs_rich-0.0.1/rich-ext/examples/tracing_adapter.rs +19 -0
  263. rs_rich-0.0.1/rich-ext/examples/transfers.rs +123 -0
  264. rs_rich-0.0.1/rich-ext/examples/workflow.rs +134 -0
  265. rs_rich-0.0.1/rich-ext/src/a11y/contrast.rs +597 -0
  266. rs_rich-0.0.1/rich-ext/src/a11y/mod.rs +10 -0
  267. rs_rich-0.0.1/rich-ext/src/a11y/policy.rs +312 -0
  268. rs_rich-0.0.1/rich-ext/src/a11y/semantic.rs +523 -0
  269. rs_rich-0.0.1/rich-ext/src/adapters/log.rs +45 -0
  270. rs_rich-0.0.1/rich-ext/src/adapters/mod.rs +13 -0
  271. rs_rich-0.0.1/rich-ext/src/adapters/tracing.rs +253 -0
  272. rs_rich-0.0.1/rich-ext/src/ansi_explain.rs +1221 -0
  273. rs_rich-0.0.1/rich-ext/src/badge.rs +391 -0
  274. rs_rich-0.0.1/rich-ext/src/cancel.rs +150 -0
  275. rs_rich-0.0.1/rich-ext/src/capabilities.rs +1032 -0
  276. rs_rich-0.0.1/rich-ext/src/cli.rs +93 -0
  277. rs_rich-0.0.1/rich-ext/src/cli_doc/clap.rs +464 -0
  278. rs_rich-0.0.1/rich-ext/src/cli_doc/completion.rs +1121 -0
  279. rs_rich-0.0.1/rich-ext/src/cli_doc/config.rs +366 -0
  280. rs_rich-0.0.1/rich-ext/src/cli_doc/docs.rs +592 -0
  281. rs_rich-0.0.1/rich-ext/src/cli_doc/error.rs +382 -0
  282. rs_rich-0.0.1/rich-ext/src/cli_doc/help.rs +526 -0
  283. rs_rich-0.0.1/rich-ext/src/cli_doc/mod.rs +155 -0
  284. rs_rich-0.0.1/rich-ext/src/cli_doc/precedence.rs +287 -0
  285. rs_rich-0.0.1/rich-ext/src/cli_doc/spec.rs +626 -0
  286. rs_rich-0.0.1/rich-ext/src/countdown.rs +737 -0
  287. rs_rich-0.0.1/rich-ext/src/dashboard.rs +271 -0
  288. rs_rich-0.0.1/rich-ext/src/data/config.rs +133 -0
  289. rs_rich-0.0.1/rich-ext/src/data/diff.rs +182 -0
  290. rs_rich-0.0.1/rich-ext/src/data/dotenv.rs +209 -0
  291. rs_rich-0.0.1/rich-ext/src/data/explorer.rs +515 -0
  292. rs_rich-0.0.1/rich-ext/src/data/flatten.rs +218 -0
  293. rs_rich-0.0.1/rich-ext/src/data/helpers.rs +83 -0
  294. rs_rich-0.0.1/rich-ext/src/data/ini.rs +203 -0
  295. rs_rich-0.0.1/rich-ext/src/data/json.rs +102 -0
  296. rs_rich-0.0.1/rich-ext/src/data/mod.rs +1184 -0
  297. rs_rich-0.0.1/rich-ext/src/data/redact.rs +169 -0
  298. rs_rich-0.0.1/rich-ext/src/data/search.rs +487 -0
  299. rs_rich-0.0.1/rich-ext/src/data/select.rs +868 -0
  300. rs_rich-0.0.1/rich-ext/src/data/ser.rs +348 -0
  301. rs_rich-0.0.1/rich-ext/src/data/table.rs +255 -0
  302. rs_rich-0.0.1/rich-ext/src/data/toml_doc.rs +88 -0
  303. rs_rich-0.0.1/rich-ext/src/data/transform.rs +300 -0
  304. rs_rich-0.0.1/rich-ext/src/data/xml.rs +216 -0
  305. rs_rich-0.0.1/rich-ext/src/data/yaml.rs +466 -0
  306. rs_rich-0.0.1/rich-ext/src/derive.rs +170 -0
  307. rs_rich-0.0.1/rich-ext/src/diagnostic.rs +814 -0
  308. rs_rich-0.0.1/rich-ext/src/diff/assert.rs +287 -0
  309. rs_rich-0.0.1/rich-ext/src/diff/engine.rs +607 -0
  310. rs_rich-0.0.1/rich-ext/src/diff/git.rs +1130 -0
  311. rs_rich-0.0.1/rich-ext/src/diff/mod.rs +79 -0
  312. rs_rich-0.0.1/rich-ext/src/diff/render.rs +583 -0
  313. rs_rich-0.0.1/rich-ext/src/diff/source.rs +240 -0
  314. rs_rich-0.0.1/rich-ext/src/diff/test_report/junit.rs +459 -0
  315. rs_rich-0.0.1/rich-ext/src/diff/test_report/libtest.rs +231 -0
  316. rs_rich-0.0.1/rich-ext/src/diff/test_report/mod.rs +484 -0
  317. rs_rich-0.0.1/rich-ext/src/diff/transform.rs +44 -0
  318. rs_rich-0.0.1/rich-ext/src/diff/view.rs +417 -0
  319. rs_rich-0.0.1/rich-ext/src/encoding.rs +143 -0
  320. rs_rich-0.0.1/rich-ext/src/env_inspect.rs +548 -0
  321. rs_rich-0.0.1/rich-ext/src/event.rs +342 -0
  322. rs_rich-0.0.1/rich-ext/src/fidelity.rs +481 -0
  323. rs_rich-0.0.1/rich-ext/src/format.rs +336 -0
  324. rs_rich-0.0.1/rich-ext/src/hex.rs +415 -0
  325. rs_rich-0.0.1/rich-ext/src/highlighter.rs +47 -0
  326. rs_rich-0.0.1/rich-ext/src/hyperlink.rs +457 -0
  327. rs_rich-0.0.1/rich-ext/src/layout/constraints.rs +160 -0
  328. rs_rich-0.0.1/rich-ext/src/layout/mod.rs +9 -0
  329. rs_rich-0.0.1/rich-ext/src/layout/node.rs +316 -0
  330. rs_rich-0.0.1/rich-ext/src/layout/overflow.rs +39 -0
  331. rs_rich-0.0.1/rich-ext/src/layout/overflowing.rs +128 -0
  332. rs_rich-0.0.1/rich-ext/src/lib.rs +148 -0
  333. rs_rich-0.0.1/rich-ext/src/live/mod.rs +334 -0
  334. rs_rich-0.0.1/rich-ext/src/live/region.rs +12 -0
  335. rs_rich-0.0.1/rich-ext/src/log_handler.rs +579 -0
  336. rs_rich-0.0.1/rich-ext/src/macros.rs +204 -0
  337. rs_rich-0.0.1/rich-ext/src/notify.rs +457 -0
  338. rs_rich-0.0.1/rich-ext/src/qa/bench.rs +621 -0
  339. rs_rich-0.0.1/rich-ext/src/qa/explain.rs +572 -0
  340. rs_rich-0.0.1/rich-ext/src/qa/fuzz.rs +1261 -0
  341. rs_rich-0.0.1/rich-ext/src/qa/lint.rs +764 -0
  342. rs_rich-0.0.1/rich-ext/src/qa/matrix.rs +456 -0
  343. rs_rich-0.0.1/rich-ext/src/qa/mod.rs +294 -0
  344. rs_rich-0.0.1/rich-ext/src/qa/profile.rs +399 -0
  345. rs_rich-0.0.1/rich-ext/src/qa/screenshot.rs +546 -0
  346. rs_rich-0.0.1/rich-ext/src/qa/stress.rs +330 -0
  347. rs_rich-0.0.1/rich-ext/src/redact.rs +1251 -0
  348. rs_rich-0.0.1/rich-ext/src/registry.rs +906 -0
  349. rs_rich-0.0.1/rich-ext/src/sanitize.rs +111 -0
  350. rs_rich-0.0.1/rich-ext/src/size_bar.rs +301 -0
  351. rs_rich-0.0.1/rich-ext/src/source_view.rs +528 -0
  352. rs_rich-0.0.1/rich-ext/src/stacktrace.rs +787 -0
  353. rs_rich-0.0.1/rich-ext/src/table/data.rs +284 -0
  354. rs_rich-0.0.1/rich-ext/src/table/group.rs +297 -0
  355. rs_rich-0.0.1/rich-ext/src/table/mod.rs +410 -0
  356. rs_rich-0.0.1/rich-ext/src/table/sort.rs +265 -0
  357. rs_rich-0.0.1/rich-ext/src/table/stream.rs +653 -0
  358. rs_rich-0.0.1/rich-ext/src/table/transform.rs +26 -0
  359. rs_rich-0.0.1/rich-ext/src/target.rs +226 -0
  360. rs_rich-0.0.1/rich-ext/src/testing/conformance.rs +336 -0
  361. rs_rich-0.0.1/rich-ext/src/testing.rs +166 -0
  362. rs_rich-0.0.1/rich-ext/src/theme.rs +111 -0
  363. rs_rich-0.0.1/rich-ext/src/transfer.rs +1127 -0
  364. rs_rich-0.0.1/rich-ext/src/transform.rs +357 -0
  365. rs_rich-0.0.1/rich-ext/src/unicode_inspect.rs +569 -0
  366. rs_rich-0.0.1/rich-ext/src/workflow/command.rs +689 -0
  367. rs_rich-0.0.1/rich-ext/src/workflow/mod.rs +363 -0
  368. rs_rich-0.0.1/rich-ext/src/workflow/summary.rs +324 -0
  369. rs_rich-0.0.1/rich-ext/src/workflow/tasks.rs +731 -0
  370. rs_rich-0.0.1/rich-lumis/Cargo.toml +55 -0
  371. rs_rich-0.0.1/rich-lumis/LICENSE +27 -0
  372. rs_rich-0.0.1/rich-lumis/README.md +30 -0
  373. rs_rich-0.0.1/rich-lumis/src/lib.rs +449 -0
  374. rs_rich-0.0.1/rich-mermaid/Cargo.toml +50 -0
  375. rs_rich-0.0.1/rich-mermaid/LICENSE +27 -0
  376. rs_rich-0.0.1/rich-mermaid/README.md +60 -0
  377. rs_rich-0.0.1/rich-mermaid/src/flowchart.rs +990 -0
  378. rs_rich-0.0.1/rich-mermaid/src/layout.rs +1268 -0
  379. rs_rich-0.0.1/rich-mermaid/src/lib.rs +358 -0
  380. rs_rich-0.0.1/rich-mermaid/src/mmdc.rs +331 -0
  381. rs_rich-0.0.1/rich-plugin-api/Cargo.toml +36 -0
  382. rs_rich-0.0.1/rich-plugin-api/LICENSE +27 -0
  383. rs_rich-0.0.1/rich-plugin-api/README.md +32 -0
  384. rs_rich-0.0.1/rich-plugin-api/src/lib.rs +320 -0
  385. rs_rich-0.0.1/rich-py/.gitignore +6 -0
  386. rs_rich-0.0.1/rich-py/Cargo.lock +2806 -0
  387. rs_rich-0.0.1/rich-py/Cargo.toml +48 -0
  388. rs_rich-0.0.1/rich-py/README.md +56 -0
  389. rs_rich-0.0.1/rich-py/examples/star_wars.py +24 -0
  390. rs_rich-0.0.1/rich-py/oracles/.gitignore +1 -0
  391. rs_rich-0.0.1/rich-py/oracles/README.md +21 -0
  392. rs_rich-0.0.1/rich-py/oracles/fill_expected.py +40 -0
  393. rs_rich-0.0.1/rich-py/src/art/diff.rs +244 -0
  394. rs_rich-0.0.1/rich-py/src/art/figlet.rs +214 -0
  395. rs_rich-0.0.1/rich-py/src/art/gif.rs +354 -0
  396. rs_rich-0.0.1/rich-py/src/art/image.rs +1140 -0
  397. rs_rich-0.0.1/rich-py/src/art/mermaid.rs +632 -0
  398. rs_rich-0.0.1/rich-py/src/art.rs +319 -0
  399. rs_rich-0.0.1/rich-py/src/boxes.rs +104 -0
  400. rs_rich-0.0.1/rich-py/src/cli.rs +63 -0
  401. rs_rich-0.0.1/rich-py/src/code/highlighter.rs +500 -0
  402. rs_rich-0.0.1/rich-py/src/code/inspect.rs +450 -0
  403. rs_rich-0.0.1/rich-py/src/code/json.rs +170 -0
  404. rs_rich-0.0.1/rich-py/src/code/layout.rs +222 -0
  405. rs_rich-0.0.1/rich-py/src/code/markdown.rs +212 -0
  406. rs_rich-0.0.1/rich-py/src/code/pretty.rs +2014 -0
  407. rs_rich-0.0.1/rich-py/src/code/syntax.rs +783 -0
  408. rs_rich-0.0.1/rich-py/src/code/traceback.rs +1389 -0
  409. rs_rich-0.0.1/rich-py/src/code.rs +111 -0
  410. rs_rich-0.0.1/rich-py/src/color/emoji.rs +158 -0
  411. rs_rich-0.0.1/rich-py/src/color/markup.rs +58 -0
  412. rs_rich-0.0.1/rich-py/src/color.rs +620 -0
  413. rs_rich-0.0.1/rich-py/src/console.rs +2736 -0
  414. rs_rich-0.0.1/rich-py/src/convert.rs +136 -0
  415. rs_rich-0.0.1/rich-py/src/errors.rs +37 -0
  416. rs_rich-0.0.1/rich-py/src/ext/cli_doc.rs +927 -0
  417. rs_rich-0.0.1/rich-py/src/ext/common.rs +358 -0
  418. rs_rich-0.0.1/rich-py/src/ext/data.rs +1392 -0
  419. rs_rich-0.0.1/rich-py/src/ext/diagnostic.rs +1728 -0
  420. rs_rich-0.0.1/rich-py/src/ext/diff.rs +1091 -0
  421. rs_rich-0.0.1/rich-py/src/ext/inspect.rs +778 -0
  422. rs_rich-0.0.1/rich-py/src/ext/layout.rs +652 -0
  423. rs_rich-0.0.1/rich-py/src/ext/qa.rs +764 -0
  424. rs_rich-0.0.1/rich-py/src/ext/registry.rs +27 -0
  425. rs_rich-0.0.1/rich-py/src/ext/status.rs +993 -0
  426. rs_rich-0.0.1/rich-py/src/ext/tables.rs +886 -0
  427. rs_rich-0.0.1/rich-py/src/ext/terminal.rs +1313 -0
  428. rs_rich-0.0.1/rich-py/src/ext/transform.rs +201 -0
  429. rs_rich-0.0.1/rich-py/src/ext/widgets.rs +680 -0
  430. rs_rich-0.0.1/rich-py/src/ext/workflow.rs +1018 -0
  431. rs_rich-0.0.1/rich-py/src/ext.rs +46 -0
  432. rs_rich-0.0.1/rich-py/src/lib.rs +87 -0
  433. rs_rich-0.0.1/rich-py/src/limits.rs +69 -0
  434. rs_rich-0.0.1/rich-py/src/live/glue.py +279 -0
  435. rs_rich-0.0.1/rich-py/src/live/live_display.rs +886 -0
  436. rs_rich-0.0.1/rich-py/src/live/live_render.rs +252 -0
  437. rs_rich-0.0.1/rich-py/src/live/logging.rs +358 -0
  438. rs_rich-0.0.1/rich-py/src/live/progress.rs +2956 -0
  439. rs_rich-0.0.1/rich-py/src/live/progress_bar.rs +316 -0
  440. rs_rich-0.0.1/rich-py/src/live/prompt.rs +453 -0
  441. rs_rich-0.0.1/rich-py/src/live/screen.rs +529 -0
  442. rs_rich-0.0.1/rich-py/src/live/status.rs +424 -0
  443. rs_rich-0.0.1/rich-py/src/live/util.rs +408 -0
  444. rs_rich-0.0.1/rich-py/src/live.rs +107 -0
  445. rs_rich-0.0.1/rich-py/src/panel.rs +418 -0
  446. rs_rich-0.0.1/rich-py/src/plugins/adapters.rs +603 -0
  447. rs_rich-0.0.1/rich-py/src/plugins/code.rs +679 -0
  448. rs_rich-0.0.1/rich-py/src/plugins/errors.rs +237 -0
  449. rs_rich-0.0.1/rich-py/src/plugins/plugin.rs +410 -0
  450. rs_rich-0.0.1/rich-py/src/plugins/registry.rs +533 -0
  451. rs_rich-0.0.1/rich-py/src/plugins/types.rs +285 -0
  452. rs_rich-0.0.1/rich-py/src/plugins.rs +52 -0
  453. rs_rich-0.0.1/rich-py/src/protocol.rs +475 -0
  454. rs_rich-0.0.1/rich-py/src/renderable.rs +925 -0
  455. rs_rich-0.0.1/rich-py/src/renderables/align.rs +460 -0
  456. rs_rich-0.0.1/rich-py/src/renderables/bar.rs +158 -0
  457. rs_rich-0.0.1/rich-py/src/renderables/columns.rs +245 -0
  458. rs_rich-0.0.1/rich-py/src/renderables/constrain.rs +160 -0
  459. rs_rich-0.0.1/rich-py/src/renderables/containers.rs +284 -0
  460. rs_rich-0.0.1/rich-py/src/renderables/layout.rs +903 -0
  461. rs_rich-0.0.1/rich-py/src/renderables/padding.rs +234 -0
  462. rs_rich-0.0.1/rich-py/src/renderables/rule.rs +182 -0
  463. rs_rich-0.0.1/rich-py/src/renderables/spinner.rs +423 -0
  464. rs_rich-0.0.1/rich-py/src/renderables/tree.rs +238 -0
  465. rs_rich-0.0.1/rich-py/src/renderables.rs +226 -0
  466. rs_rich-0.0.1/rich-py/src/segment.rs +249 -0
  467. rs_rich-0.0.1/rich-py/src/style.rs +847 -0
  468. rs_rich-0.0.1/rich-py/src/table.rs +848 -0
  469. rs_rich-0.0.1/rich-py/src/terminal_theme.rs +92 -0
  470. rs_rich-0.0.1/rich-py/src/text/lines.rs +166 -0
  471. rs_rich-0.0.1/rich-py/src/text/ops.rs +428 -0
  472. rs_rich-0.0.1/rich-py/src/text.rs +1238 -0
  473. rs_rich-0.0.1/rich-py/src/theme.rs +211 -0
  474. rs_rich-0.0.1/rich-py/tests/conftest.py +46 -0
  475. rs_rich-0.0.1/rich-py/tests/smoke.py +39 -0
  476. rs_rich-0.0.1/rich-py/tests/test_api.py +113 -0
  477. rs_rich-0.0.1/rich-py/tests/test_art.py +935 -0
  478. rs_rich-0.0.1/rich-py/tests/test_cli.py +312 -0
  479. rs_rich-0.0.1/rich-py/tests/test_code.py +645 -0
  480. rs_rich-0.0.1/rich-py/tests/test_compat.py +400 -0
  481. rs_rich-0.0.1/rich-py/tests/test_console.py +487 -0
  482. rs_rich-0.0.1/rich-py/tests/test_docs.py +98 -0
  483. rs_rich-0.0.1/rich-py/tests/test_ext.py +67 -0
  484. rs_rich-0.0.1/rich-py/tests/test_ext_data.py +200 -0
  485. rs_rich-0.0.1/rich-py/tests/test_ext_diagnostic.py +281 -0
  486. rs_rich-0.0.1/rich-py/tests/test_ext_diff.py +178 -0
  487. rs_rich-0.0.1/rich-py/tests/test_ext_expected.py +302 -0
  488. rs_rich-0.0.1/rich-py/tests/test_ext_inspect.py +185 -0
  489. rs_rich-0.0.1/rich-py/tests/test_ext_layout.py +212 -0
  490. rs_rich-0.0.1/rich-py/tests/test_ext_terminal.py +219 -0
  491. rs_rich-0.0.1/rich-py/tests/test_ext_workflow.py +309 -0
  492. rs_rich-0.0.1/rich-py/tests/test_integration.py +367 -0
  493. rs_rich-0.0.1/rich-py/tests/test_live.py +686 -0
  494. rs_rich-0.0.1/rich-py/tests/test_mermaid.py +647 -0
  495. rs_rich-0.0.1/rich-py/tests/test_modules.py +126 -0
  496. rs_rich-0.0.1/rich-py/tests/test_panel.py +189 -0
  497. rs_rich-0.0.1/rich-py/tests/test_plugins.py +899 -0
  498. rs_rich-0.0.1/rich-py/tests/test_protocol.py +328 -0
  499. rs_rich-0.0.1/rich-py/tests/test_renderables.py +557 -0
  500. rs_rich-0.0.1/rich-py/tests/test_robustness_console.py +372 -0
  501. rs_rich-0.0.1/rich-py/tests/test_robustness_extras.py +300 -0
  502. rs_rich-0.0.1/rich-py/tests/test_robustness_live.py +221 -0
  503. rs_rich-0.0.1/rich-py/tests/test_robustness_renderables.py +403 -0
  504. rs_rich-0.0.1/rich-py/tests/test_style.py +68 -0
  505. rs_rich-0.0.1/rich-py/tests/test_table.py +184 -0
  506. rs_rich-0.0.1/rich-py/tests/test_text.py +179 -0
  507. rs_rich-0.0.1/rich-py/tests/test_text_style.py +743 -0
rs_rich-0.0.1/PKG-INFO ADDED
@@ -0,0 +1,72 @@
1
+ Metadata-Version: 2.4
2
+ Name: rs-rich
3
+ Version: 0.0.1
4
+ Classifier: Development Status :: 2 - Pre-Alpha
5
+ Classifier: License :: OSI Approved :: MIT License
6
+ Classifier: Programming Language :: Python :: 3
7
+ Classifier: Programming Language :: Rust
8
+ Classifier: Topic :: Terminals
9
+ Summary: Rich-compatible terminal rendering, backed by the rs-rich Rust port
10
+ License: MIT
11
+ Requires-Python: >=3.9
12
+ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
13
+ Project-URL: Documentation, https://buchochelliq-labs.github.io/rs-rich-cli/python/
14
+ Project-URL: Repository, https://github.com/buchochelliq-labs/rs-rich-cli
15
+
16
+ # rs-rich (Python)
17
+
18
+ Rich-compatible terminal rendering for Python, backed by
19
+ [rs-rich](https://github.com/buchochelliq-labs/rs-rich-cli), a Rust port of
20
+ [Rich](https://github.com/Textualize/rich).
21
+
22
+ ```bash
23
+ pip install rs-rich
24
+ ```
25
+
26
+ Documentation: <https://buchochelliq-labs.github.io/rs-rich-cli/python/>, with a
27
+ [getting started guide](https://buchochelliq-labs.github.io/rs-rich-cli/python/getting-started/)
28
+ and an API reference for every module.
29
+
30
+ Move a Rich program over by changing its imports:
31
+
32
+ ```python
33
+ from rs_rich.console import Console # was: from rich.console import Console
34
+ from rs_rich.table import Table # was: from rich.table import Table
35
+
36
+ table = Table(title="Star Wars Movies")
37
+ table.add_column("Released", justify="right", style="cyan", no_wrap=True)
38
+ table.add_column("Title", style="magenta")
39
+ table.add_row("Dec 20, 2019", "Star Wars: The Rise of Skywalker")
40
+
41
+ console = Console()
42
+ console.print(table)
43
+ ```
44
+
45
+ All rendering happens in Rust. The Python package only maps Rich's classes
46
+ and arguments onto the Rust ones, so output matches Rich 15.0.0 byte for
47
+ byte (the documentation's Python section lists the few known differences).
48
+ What the port cannot do (Jupyter output, a handful of `Table` options) raises
49
+ `NotImplementedError` rather than rendering something different.
50
+
51
+ ## What is in it
52
+
53
+ | | Modules |
54
+ |---|---|
55
+ | All of Rich's API | `rs_rich` (`print`, `print_json`, `inspect`, ...), `console`, `text`, `style`, `color`, `theme`, `markup`, `emoji`, `segment`, `measure`, `box`, `errors`, `terminal_theme`, `table`, `panel`, `rule`, `padding`, `align`, `constrain`, `styled`, `bar`, `spinner`, `columns`, `containers`, `layout`, `tree`, `markdown`, `syntax`, `pretty`, `json`, `highlighter`, `traceback`, `live`, `live_render`, `status`, `screen`, `pager`, `progress`, `progress_bar`, `prompt`, `logging` |
56
+ | rs-rich's extensions | `rs_rich.ext` and its 38 submodules: diagnostics, structured data, diffs and test reports, transforms, workflows, tables and badges, terminal capabilities, inspectors, live layouts, CLI docs, testing and QA |
57
+ | Images and diagrams | `rs_rich.art` (images, Sixel, FIGlet, GIFs, image diffs; Pillow images when Pillow is installed), `rs_rich.mermaid` |
58
+ | Plugins | `rs_rich.plugins`: write highlighters, code highlighters, themes, boxes, renderers, fence renderers and transforms in Python, checked by the Rust plugin host |
59
+ | The command line | `python -m rs_rich` and the `rich-rs` script: rs-rich's `rich` command |
60
+
61
+ Your own classes render through `__rich__`, `__rich_console__` and
62
+ `__rich_measure__`, anywhere a renderable goes.
63
+
64
+ The `lumis` (tree-sitter) code highlighter is a separate build
65
+ (`maturin build --features lumis`), and Mermaid's `mmdc` backend needs
66
+ `--features mmdc` and Mermaid's own CLI.
67
+
68
+ ## Versions
69
+
70
+ The package has its own version (0.0.1) and is released from `python-v…`
71
+ tags. It bundles the rs-rich Rust crate from the same commit.
72
+
@@ -0,0 +1,56 @@
1
+ # rs-rich (Python)
2
+
3
+ Rich-compatible terminal rendering for Python, backed by
4
+ [rs-rich](https://github.com/buchochelliq-labs/rs-rich-cli), a Rust port of
5
+ [Rich](https://github.com/Textualize/rich).
6
+
7
+ ```bash
8
+ pip install rs-rich
9
+ ```
10
+
11
+ Documentation: <https://buchochelliq-labs.github.io/rs-rich-cli/python/>, with a
12
+ [getting started guide](https://buchochelliq-labs.github.io/rs-rich-cli/python/getting-started/)
13
+ and an API reference for every module.
14
+
15
+ Move a Rich program over by changing its imports:
16
+
17
+ ```python
18
+ from rs_rich.console import Console # was: from rich.console import Console
19
+ from rs_rich.table import Table # was: from rich.table import Table
20
+
21
+ table = Table(title="Star Wars Movies")
22
+ table.add_column("Released", justify="right", style="cyan", no_wrap=True)
23
+ table.add_column("Title", style="magenta")
24
+ table.add_row("Dec 20, 2019", "Star Wars: The Rise of Skywalker")
25
+
26
+ console = Console()
27
+ console.print(table)
28
+ ```
29
+
30
+ All rendering happens in Rust. The Python package only maps Rich's classes
31
+ and arguments onto the Rust ones, so output matches Rich 15.0.0 byte for
32
+ byte (the documentation's Python section lists the few known differences).
33
+ What the port cannot do (Jupyter output, a handful of `Table` options) raises
34
+ `NotImplementedError` rather than rendering something different.
35
+
36
+ ## What is in it
37
+
38
+ | | Modules |
39
+ |---|---|
40
+ | All of Rich's API | `rs_rich` (`print`, `print_json`, `inspect`, ...), `console`, `text`, `style`, `color`, `theme`, `markup`, `emoji`, `segment`, `measure`, `box`, `errors`, `terminal_theme`, `table`, `panel`, `rule`, `padding`, `align`, `constrain`, `styled`, `bar`, `spinner`, `columns`, `containers`, `layout`, `tree`, `markdown`, `syntax`, `pretty`, `json`, `highlighter`, `traceback`, `live`, `live_render`, `status`, `screen`, `pager`, `progress`, `progress_bar`, `prompt`, `logging` |
41
+ | rs-rich's extensions | `rs_rich.ext` and its 38 submodules: diagnostics, structured data, diffs and test reports, transforms, workflows, tables and badges, terminal capabilities, inspectors, live layouts, CLI docs, testing and QA |
42
+ | Images and diagrams | `rs_rich.art` (images, Sixel, FIGlet, GIFs, image diffs; Pillow images when Pillow is installed), `rs_rich.mermaid` |
43
+ | Plugins | `rs_rich.plugins`: write highlighters, code highlighters, themes, boxes, renderers, fence renderers and transforms in Python, checked by the Rust plugin host |
44
+ | The command line | `python -m rs_rich` and the `rich-rs` script: rs-rich's `rich` command |
45
+
46
+ Your own classes render through `__rich__`, `__rich_console__` and
47
+ `__rich_measure__`, anywhere a renderable goes.
48
+
49
+ The `lumis` (tree-sitter) code highlighter is a separate build
50
+ (`maturin build --features lumis`), and Mermaid's `mmdc` backend needs
51
+ `--features mmdc` and Mermaid's own CLI.
52
+
53
+ ## Versions
54
+
55
+ The package has its own version (0.0.1) and is released from `python-v…`
56
+ tags. It bundles the rs-rich Rust crate from the same commit.
@@ -0,0 +1,32 @@
1
+ [build-system]
2
+ requires = ["maturin>=1.8,<2"]
3
+ build-backend = "maturin"
4
+
5
+ [project]
6
+ name = "rs-rich"
7
+ version = "0.0.1"
8
+ description = "Rich-compatible terminal rendering, backed by the rs-rich Rust port"
9
+ readme = "README.md"
10
+ license = { text = "MIT" }
11
+ requires-python = ">=3.9"
12
+ classifiers = [
13
+ "Development Status :: 2 - Pre-Alpha",
14
+ "License :: OSI Approved :: MIT License",
15
+ "Programming Language :: Python :: 3",
16
+ "Programming Language :: Rust",
17
+ "Topic :: Terminals",
18
+ ]
19
+
20
+ [project.scripts]
21
+ # `rich` belongs to rich-cli; this package's command is `rich-rs`.
22
+ rich-rs = "rs_rich.cli:main"
23
+
24
+ [project.urls]
25
+ Repository = "https://github.com/buchochelliq-labs/rs-rich-cli"
26
+ Documentation = "https://buchochelliq-labs.github.io/rs-rich-cli/python/"
27
+
28
+ [tool.maturin]
29
+ module-name = "rs_rich._native"
30
+ features = ["extension-module"]
31
+ manifest-path = "rich-py/Cargo.toml"
32
+ python-source = "python"
@@ -0,0 +1,60 @@
1
+ """Rich-compatible terminal rendering, backed by the rs-rich Rust port.
2
+
3
+ Every class here is implemented in Rust (``rs_rich._native``); these modules
4
+ only re-export them under Rich's module paths, so a program can move from
5
+ ``rich`` by changing its imports. See the supported surface in the README.
6
+ """
7
+
8
+ from typing import IO, Any, Optional
9
+
10
+ from . import _native
11
+ from ._native import __version__
12
+ from .console import Console
13
+
14
+ __all__ = ["Console", "__version__", "get_console", "inspect", "print", "print_json", "reconfigure"]
15
+
16
+ _console: Optional[Console] = None
17
+
18
+
19
+ def get_console() -> Console:
20
+ """The global console ``rs_rich.print`` writes to, created on first use."""
21
+ global _console
22
+ if _console is None:
23
+ _console = Console()
24
+ return _console
25
+
26
+
27
+ def reconfigure(**kwargs: Any) -> None:
28
+ """``rich.reconfigure``: replace the global console with ``Console(**kwargs)``.
29
+
30
+ Rich changes the existing console in place; rs_rich's native console
31
+ cannot be, so ``get_console()`` returns a new object afterwards.
32
+ """
33
+ global _console
34
+ _console = Console(**kwargs)
35
+
36
+
37
+ def print( # noqa: A001
38
+ *objects: Any,
39
+ sep: str = " ",
40
+ end: str = "\n",
41
+ file: Optional[IO[str]] = None,
42
+ flush: bool = False,
43
+ ) -> None:
44
+ """``rich.print``: print objects to the global console (or to ``file``)."""
45
+ write_console = get_console() if file is None else Console(file=file)
46
+ write_console.print(*objects, sep=sep, end=end)
47
+
48
+
49
+ def print_json(json: Optional[str] = None, *, data: Any = None, **kwargs: Any) -> None:
50
+ """``rich.print_json``: pretty-print JSON on the global console."""
51
+ get_console().print_json(json, data=data, **kwargs)
52
+
53
+
54
+ def inspect(obj: Any, **kwargs: Any) -> None:
55
+ """``rich.inspect``: provided by ``_native.inspect`` once the code area adds it."""
56
+ implementation = getattr(_native, "inspect", None)
57
+ if implementation is None:
58
+ raise NotImplementedError("rs_rich.inspect is not implemented yet")
59
+ kwargs.setdefault("console", get_console())
60
+ implementation(obj, **kwargs)
@@ -0,0 +1,8 @@
1
+ """``python -m rs_rich``: the ``rich`` command line (see :mod:`rs_rich.cli`)."""
2
+
3
+ import sys
4
+
5
+ from rs_rich.cli import main
6
+
7
+ if __name__ == "__main__":
8
+ sys.exit(main())