Skip to main content

objinspect

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.

Features

  • Inspect functions, methods, and classes with a consistent API
  • Access signatures, parameters, return annotations, and docstrings
  • prettydir (alias: pdir) for a richer dir()-style view

Installation

From PyPI

pip install objinspect
uv add objinspect

From source

pip install git+https://github.com/zigai/objinspect
uv add git+https://github.com/zigai/objinspect

Examples

>>> 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.')

prettydir

image

License

MIT License

Metadata

Release files for objinspect 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for objinspect 1.0.1
File Size Uploaded Provenance Actions
objinspect-1.0.1.tar.gz 78.4 kB Without provenance Details for objinspect-1.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for objinspect 1.0.1
File Interpreter ABI Platform Actions
objinspect-1.0.1-py3-none-any.whl Python 3 none any Details for objinspect-1.0.1-py3-none-any.whl

Total release size: 99.2 kB

Release files / objinspect-1.0.1.tar.gz

Download URL objinspect-1.0.1.tar.gz
Size 78.4 kB
Tags Source
SHA-256 checksum
How to use checksums
54193e9d568233082683e3e07ba30bdb493946493c0df28ddabf630a3aa08d16
BLAKE2b-256 checksum
How to use checksums
aa8b39fa0fa62e090b0c6ee9ba322b6d1c88d5a54107eddc97b3d1f6c564425c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

Release files / objinspect-1.0.1-py3-none-any.whl

Download URL objinspect-1.0.1-py3-none-any.whl
Size 20.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8194dfe4ad32e12441482d99b3d59e64ec495ed212c0619c0428b6d6e1d1c86d
BLAKE2b-256 checksum
How to use checksums
9ef20f69025c14e63d27d9f93a895d5da5b24a2c15b8f504a905a0641609a76e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

Security for objinspect 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page