Skip to content

Inspect

Use mo.inspect() to explore Python objects with a rich, interactive display of their attributes, methods, and documentation.

Example

import marimo as mo

# Inspect a class
mo.inspect(list, methods=True)

# Inspect an instance
my_dict = {"key": "value"}
mo.inspect(my_dict)

# Show all attributes including private and dunder
mo.inspect(my_dict, all=True)

marimo.inspect

inspect(obj: object, *, help: bool = False, methods: bool = False, docs: bool = True, private: bool = False, dunder: bool = False, sort: bool = True, all: bool = False, value: bool = True) -> Html

Inspect a Python object.

Displays objects with their attributes, methods, and documentation in a rich HTML format. Useful for exploring objects that lack a rich repr.

PARAMETER DESCRIPTION
obj

The object to inspect.

TYPE: object

help

Show full help text (otherwise just first paragraph).

TYPE: bool DEFAULT: False

methods

Show methods.

TYPE: bool DEFAULT: False

docs

Show documentation for attributes/methods.

TYPE: bool DEFAULT: True

private

Show private attributes (starting with '_').

TYPE: bool DEFAULT: False

dunder

Show dunder attributes (starting with '__').

TYPE: bool DEFAULT: False

sort

Sort attributes alphabetically.

TYPE: bool DEFAULT: True

all

Show all attributes (methods, private, and dunder).

TYPE: bool DEFAULT: False

value

Show the object's value/repr.

TYPE: bool DEFAULT: True

RETURNS DESCRIPTION
Html

An Html object.

Example
mo.inspect(obj, methods=True)