View the structure of Python classes and functions
Project description
objinspect
View the structure of Python classes and functions.
Installation
From PyPi
pip install objinspect
From source
pip install git+https://github.com/zigai/obj-inspect
Example
>>> import math
>>> from objinspect import objinspect
>>> objinspect(math.pow)
Function(name='pow', parameters=2, description='Return x**y (x to the power of y).')
>>> objinspect(math.pow).dict
{'docstring': 'Return x**y (x to the power of y).',
'name': 'pow',
'parameters': [{'default': <class 'inspect._empty'>,
'description': None,
'kind': <_ParameterKind.POSITIONAL_ONLY: 0>,
'name': 'x',
'type': <class 'inspect._empty'>},
{'default': <class 'inspect._empty'>,
'description': None,
'kind': <_ParameterKind.POSITIONAL_ONLY: 0>,
'name': 'y',
'type': <class 'inspect._empty'>}]
}
>>> objinspect(objinspect)
>>> Function(name='objinspect', parameters=2, description='The objinspect function takes an object and an optional include_inherited flag (defaults to True) and returns either a Function object or a Class object depending on the type of object.')
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
objinspect-0.2.2.tar.gz
(8.7 kB
view details)
Built Distribution
File details
Details for the file objinspect-0.2.2.tar.gz
.
File metadata
- Download URL: objinspect-0.2.2.tar.gz
- Upload date:
- Size: 8.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f46de678dc78a0a7ab1369768b28d5a6fa15a05105416dc6f79f6d3b2258ef9e |
|
MD5 | f52afc20894e8cbe183809f0287d2ab2 |
|
BLAKE2b-256 | 9bea19942f02f4874b514a1954fc71e856dea4bdf517a5a0828891dc231056bf |
File details
Details for the file objinspect-0.2.2-py3-none-any.whl
.
File metadata
- Download URL: objinspect-0.2.2-py3-none-any.whl
- Upload date:
- Size: 10.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ba95e6c0f8508133fd47d9ffc2e93c3bf1ff1b85a48199b622ff417fffbc1dd3 |
|
MD5 | 51c6420e7a272a47f5a141ea3d3bdbcb |
|
BLAKE2b-256 | 6ce5117143d62028bcf14565a6fa47d02f3d2e2d93991a982d1428674fc6c347 |