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/objinspect
Example
>>> import math
>>> from objinspect import inspect
>>> inspect(math.pow)
Function(name='pow', parameters=2, description='Return x**y (x to the power of y).')
>>> inspect(math.pow).dict
[
{
"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"">"
}
]
>>> inspect(inspect)
Function(
name="inspect",
parameters=2,
description="The inspect 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.8.tar.gz
(14.2 kB
view details)
Built Distribution
File details
Details for the file objinspect-0.2.8.tar.gz
.
File metadata
- Download URL: objinspect-0.2.8.tar.gz
- Upload date:
- Size: 14.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e61d52357f66ad487720b0485ce2f40a34700bcf0bb63f0492245915b9b305a9 |
|
MD5 | 765c4a7890777de9cb429b5043bbbb01 |
|
BLAKE2b-256 | b12d0253abae54968dc9f98e353a4a524767fde4ce540e4eca90e2099e4abce0 |
File details
Details for the file objinspect-0.2.8-py3-none-any.whl
.
File metadata
- Download URL: objinspect-0.2.8-py3-none-any.whl
- Upload date:
- Size: 13.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 45023e72e4b73bd90df76ce144e6972c27ee3c155e0e404318114b9cfd4284a9 |
|
MD5 | e4c3f61afc9de0fd86a478324ae2d044 |
|
BLAKE2b-256 | 56ae4c9e6ca0dfc60a386f46939458a4740f7ebe652d1e51fffb2f3f6d0f97d4 |