Home / Function/ rich_print_str() — anthropic-sdk-python Function Reference

rich_print_str() — anthropic-sdk-python Function Reference

Architecture documentation for the rich_print_str() function in utils.py from the anthropic-sdk-python codebase.

Entity Profile

Dependency Diagram

graph TD
  ed917af8_5483_55a8_c5e6_be9eb94d1aca["rich_print_str()"]
  fd640620_de49_331e_578e_1d363467c440["utils.py"]
  ed917af8_5483_55a8_c5e6_be9eb94d1aca -->|defined in| fd640620_de49_331e_578e_1d363467c440
  e1a5f6ee_8492_7930_e986_7929e31489a2["print_obj()"]
  e1a5f6ee_8492_7930_e986_7929e31489a2 -->|calls| ed917af8_5483_55a8_c5e6_be9eb94d1aca
  style ed917af8_5483_55a8_c5e6_be9eb94d1aca fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/lib/utils.py lines 63–70

def rich_print_str(obj: object) -> str:
    """Like `rich.print()` but returns the string instead"""
    buf = io.StringIO()

    console = rich.console.Console(file=buf, width=120)
    console.out(obj)

    return buf.getvalue()

Subdomains

Defined In

Called By

Frequently Asked Questions

What does rich_print_str() do?
rich_print_str() is a function in the anthropic-sdk-python codebase, defined in tests/lib/utils.py.
Where is rich_print_str() defined?
rich_print_str() is defined in tests/lib/utils.py at line 63.
What calls rich_print_str()?
rich_print_str() is called by 1 function(s): print_obj.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free