EVEMISSTechnology

Repository guide · overview · v2

Textualize / rich

“Rich is a Python library for rich text and beautiful formatting in the terminal.” — as described by its authors

  • CLI Tools
  • Python
  • MIT · open-source license
Original repository
Textualize/rich
Source platform
GitHub
Repository owner / organization
Textualize
License
MIT · open-source license
Analyzed revision
9d8f9a372cc5916fd4781fec207ced7ddac2f08f
Last verified

Source checked 2026-10-03: default branch still at the analyzed revision.

Textualize/rich repository overview for Python developers

Terms used on this page
Entrypoint record
A file the analyzer marks as a place where execution can start. When it carries a __main__ guard excerpt, the file contains an if __name__ == "__main__": block and the excerpt shows what that block calls; without an excerpt, the file was flagged by its name only.
Bounded static execution path
A call chain reconstructed from the source code without running it, stopped after a fixed number of steps. It shows how far the code can be followed on paper, not what happens at run time.
Unresolved boundary
Where a static path stops because the next call goes into an external library or cannot be resolved without running the code. It marks the edge of this analysis, not a defect in the repository.
Static relations
Calls and imports found in the source. "External or unresolved" relations point outside the analyzed files.
Module role
The analyzer's label for a file, inferred from how many calls go in and out (for example core, entry/orchestration, leaf). It describes a position in the call graph, not the authors' design.
Test-like files
Files whose names or locations look like tests. This analysis counts them; it does not run them.
Observed · inferred · author-claimed · unresolved
How each statement is supported: read directly from the analyzed files; derived by the analyzer from them; stated by the repository's authors (metadata, README); or not established by this analysis.
Verified
Two uses on these pages. In an analyzer record ("verified provenance", "a verified entrypoint") it means the record was read directly from the analyzed files, which these guides call observed; for an entrypoint, the __main__ guard text is present. Since the analyzer fix of 2026-10-04, a file that only has an entrypoint-like name such as cli.py or main.py is recorded as inferred; guides analyzed before that still call such a file verified, and it is still only a guess about how the file is used. It does not mean the code was run or tested. "Last verified" is the date the guide last passed the lab's checks against the analysis record of the stated revision; it is not a review of the repository itself.

This repository holds the Python package `rich`, described by its authors as a library for rich text and formatting in the terminal. Static analysis inventoried 553 files across a `rich/` package, tests, benchmarks and docs, 63 entrypoints, 612 bounded execution paths and 11,248 relations. `rich/text.py`, `rich/style.py`, `rich/console.py` and `rich/segment.py` are the most referenced modules. No runtime behavior is established.

What this repository is

This repository is the source of a Python distribution named rich: in setup.py, a __main__ guard calls setuptools.setup(name="rich").

  • The GitHub description presents the project as a Python library for rich text and formatting in the terminal, and the listed homepage is https://rich.readthedocs.io/en/latest/.
  • It is written almost entirely in Python (1,701,402 language bytes versus small Batchfile and Makefile shares), with GitHub topics including terminal, tables, markdown, syntax-highlighting, progress-bar, emoji, traceback and tui.
  • License metadata says MIT, and a LICENSE file is present.
  • Metadata records a v15.0.0 release published 2026-04-12 and 57,362 stars as of 2026-09-14.
  • The analyzer inventoried 553 files and 3 build/dependency manifests; its summary describes the project as organized around assets, benchmarks, docs and examples, and flags rich/ (with tests/, benchmarks/ and docs/) as a subsystem.

How the code starts

  • setup.py's __main__ guard calls setuptools.setup(name="rich"); it is the packaging entry point.
  • The analyzer's repository summary states that no clear executable starting point was established for the project.
  • It detected 63 entrypoints and traced 612 bounded execution paths.
  • examples/attrs.py constructs Point3D, Triangle and Model objects under a __main__ guard.
  • Bounded traces from that guard reach Model and Triangle locally and terminate at unresolved external boundaries such as print, SystemExit and attr.Factory.
  • examples/cp_progress.py takes exactly three argv entries and copies file argv[1] to argv[2] through progress.open; examples/downloader.py passes its arguments to a download() call; examples/print_calendar.py parses a year with argparse and calls print_calendar.
  • Many rich/*.py modules carry __main__ demo blocks, often marked # pragma: no cover (for example rich/console.py, rich/markdown.py, rich/syntax.py), which suggests the package serves as its own demonstration gallery.

Structure and most connected modules

  • Four top-level directories are flagged as subsystems: rich/ (the importable package), tests/, benchmarks/ and docs/.
  • The analyzer recorded 11,248 static relations — 9,630 calls and 1,618 imports — of which 4,545 resolve locally and 6,703 remain external or unresolved.
  • By static incoming-call degree the most referenced modules are rich/text.py (707), rich/style.py (474), rich/console.py (416) and rich/segment.py (337); rich/console.py also has 78 outgoing calls, and the analyzer labels these core/orchestration candidates.
  • Test modules invert that shape: tests/test_text.py makes 329 outgoing calls with none incoming, tests/test_highlighter.py 231 and tests/test_segment.py 221 — tests drive library code rather than the reverse.
  • rich/pretty.py (149 incoming) and rich/progress.py (133) are also heavily referenced, while rich/default_styles.py has 1 incoming against 154 outgoing calls, consistent with a provider of default styles.

Dependencies and test surface

  • The dependency records in the packet come from one manifest, docs/requirements.txt: alabaster 1.0.0, Sphinx 8.2.3, sphinx-rtd-theme 3.0.2 and sphinx-copybutton 0.5.2, all pinned.
  • This picture is partial: the analyzer parses only requirements-style manifests and does not read pyproject.toml dependency tables, although the repository holds 3 build/dependency manifests.
  • The test suite spans 68 test files, including tests/conftest.py.
  • Visible test functions cover text operations (test_span, test_add, test_eq in tests/test_text.py), segment handling (test_split_lines, test_simplify in tests/test_segment.py) and highlighting (test_highlight_regex, test_highlight_json_with_indent in tests/test_highlighter.py).
  • Several test files also carry __main__ blocks that render fixtures and print results, e.g. tests/test_table.py and tests/test_card.py.
  • Install, run and build inference is partial and installation commands are unverified, so this packet yields no runnable setup instructions.

A short reading order

  • Start with README.md and pyproject.toml; the analyzer classifies both as project-level important files.
  • Then skim setup.py for packaging details and LICENSE for terms.
  • For code, read the highest-degree modules in this order: rich/text.py (its Text class spans lines 118–1335), then rich/style.py, rich/console.py and rich/segment.py.
  • Finish with the runnable examples flagged as likely entrypoints: examples/attrs.py, examples/cp_progress.py, examples/downloader.py and examples/print_calendar.py.
  • A compact end-to-end sample is rich/pager.py's demo block, which imports make_test_card from rich/__main__.py and displays it through console.pager.

Limits of this analysis

  • 6,703 of the 11,248 static relations remain external or unresolved, so many cross-file call targets were not bound to definitions.
  • Reflection, runtime dependency injection, dynamic imports, monkey-patching, generated code, framework runtime wiring and dynamic dispatch are not resolved by this static analysis.
  • Nothing here establishes runtime behavior: install, run and build inference is partial and unverified, and the bounded scan does not parse files over 400 kB, minified bundles or vendored directories, with relation extraction capped per file and per repository.
  • README text is extracted line by line and may capture code lines, so any README-derived statement should be treated as an author claim.
  • One execution path contains a detected static call cycle; whether that reflects a real runtime cycle is not established.
  • The 612 bounded execution paths are static analyzer constructions; no code was executed for this asset.

Notable symbols

  • rich/text.py: Span (lines 47–115) and the large Text class (118–1335); rich/segment.py: Segment (61–696) plus Segments and SegmentLines; rich/style.py: Style (40–759) and StyleStack.
  • rich/console.py: ConsoleOptions (113–243), Capture (310–340), PagerContext (364–400) and ScreenContext (403–447).
  • rich/progress.py: track(), wrap_file(), ProgressColumn and the column classes SpinnerColumn, TextColumn and RenderableColumn; rich/pretty.py: install() and the Pretty class.

What this analysis could not establish

The writing model's own notes on the analysis record. Identifiers such as lim_3, exec_* or claim_… name records of that analysis; the claims table cites the same records.

  • 6,703 of 11,248 static relations are external or unresolved; called names such as Console, print and attr.Factory in example traces were not bound to definitions.
  • pyproject.toml dependency tables were not parsed, so the library's own runtime dependencies are not enumerated; only the docs/requirements.txt records exist.
  • No code was executed; install, run and build behavior remains partial inference.
  • Whether the single detected static call cycle corresponds to an actual runtime cycle is unresolved.
  • All execution traces provided start from examples/attrs.py, so library-internal runtime flow (for example Console printing) is not traced.
Claims and evidence — 40 claims, 40 supported by an independent verifier

Every statement above is a claim that cites grounding IDs from the analysis. IDs are internal to the analysis run; the columns show what each claim rests on and how strong that ground is.

Every substantive statement above is a claim bound to grounding IDs of the analyzed revision. Global grounding IDs are namespaced by the analysis run.

Claim Epistemic status Verifier Grounding (global IDs)
c1 The packaging script setup.py contains a __main__ guard that calls setuptools.setup with the name "rich". observed supported analysis_7a8a98c4ba2ee6a1:py_entry_822c30480df2, analysis_7a8a98c4ba2ee6a1:important_4
c2 The repository's GitHub description presents the project as a Python library for rich text and formatting in the terminal. author_claimed supported analysis_7a8a98c4ba2ee6a1:meta_description
c3 The listed project homepage is https://rich.readthedocs.io/en/latest/. author_claimed supported analysis_7a8a98c4ba2ee6a1:meta_homepage
c4 GitHub metadata records Python as the primary language, with 1,701,402 Python language bytes versus 799 Batchfile and 307 Makefile, and topics including terminal, tables, markdown, syntax-highlighting, progress-bar, emoji, traceback and tui. observed supported analysis_7a8a98c4ba2ee6a1:meta_primary_language, analysis_7a8a98c4ba2ee6a1:meta_language_bytes, analysis_7a8a98c4ba2ee6a1:meta_topics
c5 License metadata records MIT, and a LICENSE file is present at the repository root. observed supported analysis_7a8a98c4ba2ee6a1:meta_license, analysis_7a8a98c4ba2ee6a1:important_5
c6 Platform metadata records a v15.0.0 release published 2026-04-12 and 57,362 stars as of 2026-09-14. observed supported analysis_7a8a98c4ba2ee6a1:meta_latest_release, analysis_7a8a98c4ba2ee6a1:meta_stars
c7 The analyzer inventoried 553 files and 3 build/dependency manifests; its summary describes the project as organized around assets, benchmarks, docs and examples, and flags rich/ (with tests/, benchmarks/ and docs/) as a subsystem (subsys_3). inferred supported analysis_7a8a98c4ba2ee6a1:claim_23e3492420df, analysis_7a8a98c4ba2ee6a1:ev_manifest_1, analysis_7a8a98c4ba2ee6a1:summary_repository, analysis_7a8a98c4ba2ee6a1:subsys_3, analysis_7a8a98c4ba2ee6a1:subsys_4, analysis_7a8a98c4ba2ee6a1:subsys_1, analysis_7a8a98c4ba2ee6a1:subsys_2
c8 setup.py's __main__ guard calls setuptools.setup(name="rich"), making the file the packaging entry point. observed supported analysis_7a8a98c4ba2ee6a1:py_entry_822c30480df2
c9 The analyzer's repository summary states that no clear executable starting point was established for the project. inferred supported analysis_7a8a98c4ba2ee6a1:claim_23e3492420df
c10 The analyzer's reconstruction reports 63 entrypoints and 612 bounded execution paths for the analyzed revision. inferred supported analysis_7a8a98c4ba2ee6a1:claim_20d39516a0c9
c11 examples/attrs.py's __main__ guard constructs Point3D, Triangle and Model objects. observed supported analysis_7a8a98c4ba2ee6a1:py_entry_1d954456132d
c12 Bounded traces from examples/attrs.py's guard reach Model and Triangle locally and terminate at unresolved external boundaries such as print, SystemExit and attr.Factory. inferred supported analysis_7a8a98c4ba2ee6a1:exec_04be04b62de5, analysis_7a8a98c4ba2ee6a1:exec_37bf047ba181, analysis_7a8a98c4ba2ee6a1:exec_befd398f8d93, analysis_7a8a98c4ba2ee6a1:exec_becc91576f8c, analysis_7a8a98c4ba2ee6a1:exec_c46953a9686b
c13 examples/cp_progress.py's guard takes exactly three argv entries and copies file argv[1] to argv[2] through progress.open. observed supported analysis_7a8a98c4ba2ee6a1:py_entry_1f2ed06a69bc
c14 examples/downloader.py passes its command-line arguments to a download() call, and examples/print_calendar.py parses a year argument with argparse before calling print_calendar. observed supported analysis_7a8a98c4ba2ee6a1:py_entry_73be82278272, analysis_7a8a98c4ba2ee6a1:py_entry_867f130479b4
c15 Many rich/*.py modules carry __main__ demo blocks, often marked '# pragma: no cover' (rich/console.py, rich/markdown.py, rich/syntax.py); interpreted as the package acting as its own gallery. inferred supported analysis_7a8a98c4ba2ee6a1:py_entry_f7ba4b240341, analysis_7a8a98c4ba2ee6a1:py_entry_ca54fb7aed5a, analysis_7a8a98c4ba2ee6a1:py_entry_35e902eaf65d
c16 Analyzer-flagged subsystems: rich/ (package), tests/, benchmarks/ and docs/. observed supported analysis_7a8a98c4ba2ee6a1:subsys_3, analysis_7a8a98c4ba2ee6a1:subsys_4, analysis_7a8a98c4ba2ee6a1:subsys_1, analysis_7a8a98c4ba2ee6a1:subsys_2
c17 relation_counts records 11,248 static relations: 9,630 calls and 1,618 imports; 4,545 local versus 6,703 external_or_unresolved. observed supported analysis_7a8a98c4ba2ee6a1:relation_counts
c18 By static incoming-call degree the most referenced modules are rich/text.py (707), rich/style.py (474), rich/console.py (416) and rich/segment.py (337); rich/console.py also has 78 outgoing calls; the analyzer labels these core/orchestration candidates. inferred supported analysis_7a8a98c4ba2ee6a1:role_129, analysis_7a8a98c4ba2ee6a1:role_124, analysis_7a8a98c4ba2ee6a1:role_87, analysis_7a8a98c4ba2ee6a1:role_121
c19 Test modules show the opposite shape: tests/test_text.py (329 outgoing, 0 incoming), tests/test_highlighter.py (231) and tests/test_segment.py (221) primarily call library code. inferred supported analysis_7a8a98c4ba2ee6a1:role_191, analysis_7a8a98c4ba2ee6a1:role_155, analysis_7a8a98c4ba2ee6a1:role_183
c20 rich/pretty.py (149 incoming calls) and rich/progress.py (133) are also heavily referenced; rich/default_styles.py shows 1 incoming and 154 outgoing calls, consistent with a default style provider. inferred supported analysis_7a8a98c4ba2ee6a1:role_111, analysis_7a8a98c4ba2ee6a1:role_112, analysis_7a8a98c4ba2ee6a1:role_91
c21 The parsed dependency records come from docs/requirements.txt: alabaster==1.0.0, Sphinx==8.2.3, sphinx-rtd-theme==3.0.2, sphinx-copybutton==0.5.2. observed supported analysis_7a8a98c4ba2ee6a1:dep_1, analysis_7a8a98c4ba2ee6a1:dep_2, analysis_7a8a98c4ba2ee6a1:dep_3, analysis_7a8a98c4ba2ee6a1:dep_4
c22 Dependency coverage is partial: v0.10 parses only requirements-style manifests, not pyproject.toml dependency tables, though the repository contains 3 build/dependency manifest files. observed supported analysis_7a8a98c4ba2ee6a1:lim_3, analysis_7a8a98c4ba2ee6a1:ev_manifest_1
c23 Repository evidence counts 68 test files, with tests/conftest.py among them. observed supported analysis_7a8a98c4ba2ee6a1:ev_tests_1
c24 tests/test_text.py defines test_span, test_add and test_eq; tests/test_segment.py defines test_split_lines and test_simplify; tests/test_highlighter.py defines test_highlight_regex and test_highlight_json_with_indent. observed supported analysis_7a8a98c4ba2ee6a1:py_func_5f630b93098e, analysis_7a8a98c4ba2ee6a1:py_func_64083b259880, analysis_7a8a98c4ba2ee6a1:py_func_e1a38cdd3b1b, analysis_7a8a98c4ba2ee6a1:py_func_3fecfe21eab0, analysis_7a8a98c4ba2ee6a1:py_func_5698dc14d9b3, analysis_7a8a98c4ba2ee6a1:py_func_fb7b107e4418, analysis_7a8a98c4ba2ee6a1:py_func_c0254d2d9bac
c25 Several tests/*.py files also carry __main__ blocks that render fixtures and print results (tests/test_table.py, tests/test_card.py). observed supported analysis_7a8a98c4ba2ee6a1:py_entry_f9fc3f1e1e43, analysis_7a8a98c4ba2ee6a1:py_entry_a4c567106ebf
c26 Install, run and build inference is partial and installation commands are not verified, so no runnable instructions follow from this packet. observed supported analysis_7a8a98c4ba2ee6a1:lim_2
c27 README.md and pyproject.toml are classified as project-level important files. observed supported analysis_7a8a98c4ba2ee6a1:important_1, analysis_7a8a98c4ba2ee6a1:important_3
c28 setup.py and LICENSE are also flagged as project-level important files. observed supported analysis_7a8a98c4ba2ee6a1:important_4, analysis_7a8a98c4ba2ee6a1:important_5
c29 Read the highest-degree modules in order: rich/text.py (Text class at lines 118-1335), rich/style.py, rich/console.py, rich/segment.py; the ordering follows static incoming-call degree. inferred supported analysis_7a8a98c4ba2ee6a1:role_129, analysis_7a8a98c4ba2ee6a1:role_124, analysis_7a8a98c4ba2ee6a1:role_87, analysis_7a8a98c4ba2ee6a1:role_121, analysis_7a8a98c4ba2ee6a1:py_class_830a06ef91f6
c30 examples/attrs.py, examples/cp_progress.py, examples/downloader.py and examples/print_calendar.py are flagged as important because they are likely entrypoints. observed supported analysis_7a8a98c4ba2ee6a1:important_6, analysis_7a8a98c4ba2ee6a1:important_7, analysis_7a8a98c4ba2ee6a1:important_8, analysis_7a8a98c4ba2ee6a1:important_9
c31 rich/pager.py's __main__ block imports make_test_card from rich/__main__.py and displays it with console.pager, giving a compact end-to-end rendering sample. observed supported analysis_7a8a98c4ba2ee6a1:py_entry_09013b2aeee2
c32 6,703 of the 11,248 static relations remain external or unresolved. observed supported analysis_7a8a98c4ba2ee6a1:relation_counts
c33 Reflection, runtime dependency injection, dynamic imports, monkey-patching, generated code, framework runtime wiring and dynamic dispatch are not resolved by this static analysis. observed supported analysis_7a8a98c4ba2ee6a1:lim_1
c34 Install/run/build inference is partial and unverified; the bounded v0.10 scan does not parse files over 400 kB, minified bundles or vendored directories, and relation extraction is capped at 2,500 relations per file and 150,000 per repository. observed supported analysis_7a8a98c4ba2ee6a1:lim_2, analysis_7a8a98c4ba2ee6a1:lim_6
c35 README claim extraction is line-based and may capture code lines, so README-derived statements should be treated as author claims. observed supported analysis_7a8a98c4ba2ee6a1:lim_4
c36 One execution path contains a detected static call cycle; its runtime significance is not established. unresolved supported analysis_7a8a98c4ba2ee6a1:claim_d159136010a2
c37 The 612 bounded execution paths are static analyzer constructions; no code was executed in producing this asset. inferred supported analysis_7a8a98c4ba2ee6a1:claim_20d39516a0c9
c38 Named core classes: Span (rich/text.py lines 47-115), Text (rich/text.py 118-1335), Segment (rich/segment.py 61-696) with Segments and SegmentLines, and Style (rich/style.py 40-759) with StyleStack. observed supported analysis_7a8a98c4ba2ee6a1:py_class_e3dd5a13b68c, analysis_7a8a98c4ba2ee6a1:py_class_830a06ef91f6, analysis_7a8a98c4ba2ee6a1:py_class_00718f5f76d9, analysis_7a8a98c4ba2ee6a1:py_class_2bd22f4a1c68, analysis_7a8a98c4ba2ee6a1:py_class_f35b4e274c5b, analysis_7a8a98c4ba2ee6a1:py_class_f30261dc4e2a, analysis_7a8a98c4ba2ee6a1:py_class_abe5e7e79786
c39 rich/console.py defines ConsoleOptions (lines 113-243), Capture (310-340), PagerContext (364-400) and ScreenContext (403-447). observed supported analysis_7a8a98c4ba2ee6a1:py_class_ad46e73abd24, analysis_7a8a98c4ba2ee6a1:py_class_774667135a39, analysis_7a8a98c4ba2ee6a1:py_class_aa99194d246f, analysis_7a8a98c4ba2ee6a1:py_class_be47469e240a
c40 rich/progress.py provides track(), wrap_file(), ProgressColumn and the column classes SpinnerColumn, TextColumn and RenderableColumn; rich/pretty.py provides install() and the Pretty class. observed supported analysis_7a8a98c4ba2ee6a1:py_func_edebfaebc8e0, analysis_7a8a98c4ba2ee6a1:py_func_1078253745c3, analysis_7a8a98c4ba2ee6a1:py_class_7e501b28002e, analysis_7a8a98c4ba2ee6a1:py_class_29092f2ba209, analysis_7a8a98c4ba2ee6a1:py_class_c11a4bc6d416, analysis_7a8a98c4ba2ee6a1:py_class_2f12b968f2a4, analysis_7a8a98c4ba2ee6a1:py_func_0d7b204e51c4, analysis_7a8a98c4ba2ee6a1:py_class_169f19b62824

Sources, rights and disclosure · attribution-license-templates/v0.1

Rights notice. Original repository hosted on GitHub. Repository source code, documentation, names, media, and related project materials remain subject to the rights of their respective authors, contributors, and other rights holders and to applicable repository license terms.

Platform notice. GitHub is the source hosting platform for the linked repository. GitHub and related marks are trademarks of GitHub, Inc. EVEMISS Technology is not affiliated with or endorsed by GitHub unless explicitly stated otherwise.

How this page is produced. This page was produced using revision-aware repository analysis and AI-assisted editorial tooling. Technical claims are tied to the analyzed repository revision and may be revalidated when the source repository changes.

AI-assisted analysis. Reviewed by EVEMISS Technology through human–AI collaborative review. · Report a rights concern · All repository guides