https://github.com/zigai/objinspect
A high-level library for Python object inspection
https://github.com/zigai/objinspect
function-signature inspect-type-hints introspection metaprogramming object-inspection python python-inspect
Last synced: about 1 month ago
JSON representation
A high-level library for Python object inspection
- Host: GitHub
- URL: https://github.com/zigai/objinspect
- Owner: zigai
- License: mit
- Created: 2022-09-17T18:11:32.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2025-02-14T09:57:03.000Z (3 months ago)
- Last Synced: 2025-03-22T19:05:28.562Z (2 months ago)
- Topics: function-signature, inspect-type-hints, introspection, metaprogramming, object-inspection, python, python-inspect
- Language: Python
- Homepage: https://objinspect.readthedocs.io
- Size: 134 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# objinspect
[](https://github.com/zigai/objinspect/actions/workflows/tests.yml)
[](https://objinspect.readthedocs.io/en/latest/?badge=latest)
[](https://badge.fury.io/py/objinspect)

[](https://pepy.tech/project/objinspect)
[](https://pepy.tech/project/objinspect)
[](https://github.com/zigai/objinspect/blob/main/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.## Features
- Simplified inspection of Python objects (classes, functions, methods)
- Detailed information about parameters, return types, and docstrings
- prettydir - like dir(), but with more information and prettier output## Installation
#### From PyPi
```
pip install objinspect
```
#### From source
```
pip install git+https://github.com/zigai/objinspect
```## Examples
``` python
>>> 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': , 'default': , 'description': None},
{'name': 'y', 'kind': <_ParameterKind.POSITIONAL_ONLY: 0>, 'type': , 'default': , 'description': None}],
'docstring': 'Return x**y (x to the power of y).'
}
>>> inspect(inspect)
Function(name='inspect', parameters=7, description='Inspects an object and returns a structured representation of its attributes and methods.')
```
### prettydir
## License
[MIT License](https://github.com/zigai/obj-inspect/blob/master/LICENSE)