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.4.tar.gz
(8.8 kB
view details)
Built Distribution
File details
Details for the file objinspect-0.2.4.tar.gz
.
File metadata
- Download URL: objinspect-0.2.4.tar.gz
- Upload date:
- Size: 8.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf6235cceb09f82d44f14370b13c974ae815428d9934baea5d0802d3010b298f |
|
MD5 | c3eca7099fdb25ceee86911fb179431d |
|
BLAKE2b-256 | 51428ca4c7adb813ee6651a1bdde892898e2f788265cf97d5b45d582759ecfc4 |
File details
Details for the file objinspect-0.2.4-py3-none-any.whl
.
File metadata
- Download URL: objinspect-0.2.4-py3-none-any.whl
- Upload date:
- Size: 10.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d85a7312b7d42f25c9a5bbafc3169a914b7202c64549ae8190e72ebfaa825f4a |
|
MD5 | cbc110862f4c7a6479507d881b3f0e42 |
|
BLAKE2b-256 | 3a87790e0d915c794ecbde601da7b646152abc39ee4cd36d494fb734f4f0c276 |