class_docstr: Stores the minimum and maximum widths (in characters) required to render an object.
class_docstr_tok: ["Stores","the","minimum","and","maximum","widths","(","in","characters",")","required","to","render","an","object","."]
docstr: Get a measurement for a renderable.
  
  Args:
      console (~rich.console.Console): Console instance.
      options (~rich.console.ConsoleOptions): Console options.
      renderable (RenderableType): An object that may be rendered with Rich.
  
  Raises:
      errors.NotRenderableError: If the object is not renderable.
  
  Returns:
      Measurement: Measurement object containing range of character widths required to render the object.
docstr_tok: ["Get","a","measurement","for","a","renderable",".","Args",":","console","(","~rich.console.Console",")",":","Console","instance",".","options","(","~rich.console.ConsoleOptions",")",":","Console","options",".","renderable","(","RenderableType",")",":","An","object","that","may","be","rendered","with","Rich",".","Raises",":","errors.NotRenderableError",":","If","the","object","is","not","renderable",".","Returns",":","Measurement",":","Measurement","object","containing","range","of","character","widths","required","to","render","the","object","."]
code: def get(
      cls,
      console: "Console",
      options: "ConsoleOptions",
      renderable: "RenderableType",
  ) -> "Measurement":
      """Get a measurement for a renderable.
  
      Args:
          console (~rich.console.Console): Console instance.
          options (~rich.console.ConsoleOptions): Console options.
          renderable (RenderableType): An object that may be rendered with Rich.
  
      Raises:
          errors.NotRenderableError: If the object is not renderable.
  
      Returns:
          Measurement: Measurement object containing range of character widths required to render the object.
      """
      _max_width = options.max_width
      if _max_width < 1:
          return Measurement(0, 0)
      if isinstance(renderable, str):
          renderable = console.render_str(
              renderable, markup=options.markup, highlight=False
          )
      renderable = rich_cast(renderable)
      if is_renderable(renderable):
          get_console_width: Optional[
              Callable[["Console", "ConsoleOptions"], "Measurement"]
          ] = getattr(renderable, "__rich_measure__", None)
          if get_console_width is not None:
              render_width = (
                  get_console_width(console, options)
                  .normalize()
                  .with_maximum(_max_width)
              )
              if render_width.maximum < 1:
                  return Measurement(0, 0)
              return render_width.normalize()
          else:
              return Measurement(0, _max_width)
      else:
          raise errors.NotRenderableError(
              f"Unable to get render width for {renderable!r}; "
              "a str, Segment, or object with __rich_console__ method is required"
          )
  
file_path: rich/rich/measure.py
imports: from operator import itemgetter
  from typing import TYPE_CHECKING, Callable, NamedTuple, Optional, Sequence
  from .None import errors
  from .protocol import is_renderable, rich_cast
label_desc: Use image node_id 6 for calling the Measurement obj's underlying member method code with example usage: obj.get(cls, console, options, renderable) and returns: Measurement, render_width, Measurement, Measurement