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.1.1.tar.gz
(7.0 kB
view details)
Built Distribution
File details
Details for the file objinspect-0.1.1.tar.gz
.
File metadata
- Download URL: objinspect-0.1.1.tar.gz
- Upload date:
- Size: 7.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6977b1165fc75a1d3115c0924f7b3e03b133d5c2dc0bde3fe6acc73857e1439b |
|
MD5 | 2e9ccae336829834d48a0b23c9dc4223 |
|
BLAKE2b-256 | f2203d7dbf1715221f4c6a5191d97b6932f48f1cdf05d916ada70ffd1f99844d |
File details
Details for the file objinspect-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: objinspect-0.1.1-py3-none-any.whl
- Upload date:
- Size: 8.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f21c5f31816e49614cb96786f47945e9966522af1fe98bb504584302f060763e |
|
MD5 | ba9a2855a43cb4a42406e6a5498cf302 |
|
BLAKE2b-256 | afce40c610fec32848b3ea7c4321ef9bfe8ffbe68c518237846d1e5b290d2977 |