Tests Documentation Status PyPI version Supported versions Downloads Downloads license
objinspect is a high-level wrapper around Python's built-in inspect module.
It provides a simple interface for examining Python functions and classes.
- Inspect functions, methods, and classes with a consistent API
- Access signatures, parameters, return annotations, and docstrings
prettydir(alias:pdir) for a richerdir()-style view
pip install objinspect
uv add objinspect
pip install git+https://github.com/zigai/objinspect
uv add git+https://github.com/zigai/objinspect
>>> from objinspect import inspect >>> import math >>> inspect(math.pow) Function(name='pow', parameters=2, description='Return x**y (x to the power of y).') >>> inspect(math.pow).dict { 'name': 'pow', 'parameters': [ {'name': 'x', 'kind': <_ParameterKind.POSITIONAL_ONLY: 0>, 'type': <class 'inspect._empty'>, 'default': <class 'inspect._empty'>, 'description': None}, {'name': 'y', 'kind': <_ParameterKind.POSITIONAL_ONLY: 0>, 'type': <class 'inspect._empty'>, 'default': <class 'inspect._empty'>, 'description': None}], 'docstring': 'Return x**y (x to the power of y).' } >>> inspect(inspect) Function(name='inspect', parameters=8, description='Inspects an object and returns a structured representation of its attributes and methods.')