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.6.tar.gz
(10.7 kB
view details)
Built Distribution
File details
Details for the file objinspect-0.2.6.tar.gz
.
File metadata
- Download URL: objinspect-0.2.6.tar.gz
- Upload date:
- Size: 10.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3a7071730785690cb4734944482f7a43ddedcefd0231835f15625b86d1400a1c |
|
MD5 | 80b4e3595058c452a4654a93efc043b2 |
|
BLAKE2b-256 | af3a651e126718c07c702412e3d88e157c86f72c3b8a685532f79b31c7104f43 |
File details
Details for the file objinspect-0.2.6-py3-none-any.whl
.
File metadata
- Download URL: objinspect-0.2.6-py3-none-any.whl
- Upload date:
- Size: 12.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e7afc0b69cd1dbf83a78a26baed5c619ce615346c6e32de37e59369966865a26 |
|
MD5 | aa9e2a8be6f1f9298f3849fa1ca6aef8 |
|
BLAKE2b-256 | 7eb70e0674a0ef284bbc671f1dd800fa1098e9aaa8096e84a7673357370a5654 |