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.3.tar.gz
(8.7 kB
view details)
Built Distribution
File details
Details for the file objinspect-0.2.3.tar.gz
.
File metadata
- Download URL: objinspect-0.2.3.tar.gz
- Upload date:
- Size: 8.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b03abca19a8a1e70ea568bf3fcfd76c2fbb9691c2dc5e149c347656e9e52c8eb |
|
MD5 | 8325cd2b7f7948dc5e25e74387046496 |
|
BLAKE2b-256 | 4cf27c1f0b5c6a0157447e18764022a61f764ddb672324271e70bc29bed8a378 |
File details
Details for the file objinspect-0.2.3-py3-none-any.whl
.
File metadata
- Download URL: objinspect-0.2.3-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.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 163bcf4a460b0add85dc293bd525ad4d84b3d9491fc1760c412a1cb9b48635ce |
|
MD5 | 4a996698fd4484842f44efd288906ef0 |
|
BLAKE2b-256 | 4f60d6c64589e8bf450c081fd25a5d31d81a98e45ebce9727bd006a73f95de43 |