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.0.tar.gz
(8.6 kB
view details)
Built Distribution
File details
Details for the file objinspect-0.2.0.tar.gz
.
File metadata
- Download URL: objinspect-0.2.0.tar.gz
- Upload date:
- Size: 8.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e8228854c0596350562762fbf4cb11933142e94cb60a47ef1a11736c35e9cacd |
|
MD5 | 4245bf6358e639ce10ddc1577b155e51 |
|
BLAKE2b-256 | 5130891a64505f21fdbfd2f39229e8ecde6ddfbfc71926e5a1313a409a95122e |
File details
Details for the file objinspect-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: objinspect-0.2.0-py3-none-any.whl
- Upload date:
- Size: 10.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 59817b3d25274d745418c7918251aa8001aa5e541b916725132bd483bb7fb00a |
|
MD5 | 3d9dd10a150d852edbb6300ffc3a2b6d |
|
BLAKE2b-256 | 0263db14ce1d8c0dde20e502cd9fd28ddb9096f811e47ff35963ae4dcbc65c9c |